Skip to content

Commit

Permalink
Ignore non-VNode objects during rendering
Browse files Browse the repository at this point in the history
This fixes #245.
  • Loading branch information
developit authored Sep 12, 2022
1 parent 60075a5 commit 8c7b001
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) {
}
return rendered;
}

// VNodes have {constructor:undefined} to prevent JSON injection:
if (vnode.constructor !== undefined) return '';

vnode[PARENT] = parent;
if (options[DIFF]) options[DIFF](vnode);
Expand Down

0 comments on commit 8c7b001

Please sign in to comment.