We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 161557d commit 77186c2Copy full SHA for 77186c2
lib/parse.js
@@ -63,7 +63,10 @@ module.exports = function parse(html, options) {
63
level--;
64
if (!inComponent && nextChar !== '<' && nextChar) {
65
// trailing text node
66
- arr[level].children.push({
+ // if we're at the root, push a base text node. otherwise add as
67
+ // a child to the current node.
68
+ parent = level === -1 ? result : arr[level].children;
69
+ parent.push({
70
type: 'text',
71
content: html.slice(start, html.indexOf('<', start))
72
});
0 commit comments