Skip to content

Commit 5150fe8

Browse files
committed
fix: Refactor SSR rendering logic in index.js
- Simplify logic for ignoring certain elements during rendering. - Update conditional statements to improve readability and maintainability.
1 parent 5b2c4bc commit 5150fe8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ class CoCreateServerSideRender {
2323
if (ignoreElement[el.tagName])
2424
continue;
2525

26-
if (el.tagName == "DIV" && !el.classList.contains('domEditor'))
26+
if (el.closest('.template, [template], template, [render]'))
2727
continue;
2828

29-
if (el.classList.contains('domEditor') && el.closest('.template'))
29+
if (el.hasAttribute('render-selector') || el.hasAttribute('render-closest') || el.hasAttribute('render-parent') || el.hasAttribute('render-next') || el.hasAttribute('render-next'))
3030
continue;
3131

32-
if (el.hasAttribute('actions'))
32+
if (el.hasAttribute('component') || el.hasAttribute('plugin'))
3333
continue;
3434

35+
if (el.hasAttribute('actions'))
36+
continue;
3537
let _id = meta["document_id"],
3638
collection = meta['collection'],
3739
name = meta['name'];

0 commit comments

Comments
 (0)