Skip to content

Commit 8e64082

Browse files
committedOct 27, 2020
fix: contents are split with '<' in comment, close #18, close #45
1 parent cbeb319 commit 8e64082

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎index.js

+7
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,18 @@ function postHTMLParser(html, options) {
107107
},
108108
ontext(text) {
109109
const last = bufArray.last();
110+
110111
if (!last) {
111112
results.push(text);
112113
return;
113114
}
114115

116+
if (last.content?.length && typeof last.content[last.content.length - 1] === 'string') {
117+
last.content[last.content.length - 1] = last.content[last.content.length - 1] + text
118+
return
119+
}
120+
121+
115122
last.content || (last.content = []);
116123
last.content.push(text);
117124
}

0 commit comments

Comments
 (0)
Please sign in to comment.