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 77186c2 commit d13136cCopy full SHA for d13136c
lib/parse.js
@@ -66,9 +66,14 @@ module.exports = function parse(html, options) {
66
// 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
+
70
+ // calculate correct end of the content slice in case there's
71
+ // no tag after the text node.
72
+ var end = html.indexOf('<', start);
73
+ end = end === -1 ? undefined : end;
74
parent.push({
75
type: 'text',
- content: html.slice(start, html.indexOf('<', start))
76
+ content: html.slice(start, end)
77
});
78
}
79
0 commit comments