Skip to content

Commit

Permalink
fix: contents are split with '<' in comment, close #18, close #45
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Oct 27, 2020
1 parent cbeb319 commit 8e64082
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,18 @@ function postHTMLParser(html, options) {
},
ontext(text) {
const last = bufArray.last();

if (!last) {
results.push(text);
return;
}

if (last.content?.length && typeof last.content[last.content.length - 1] === 'string') {
last.content[last.content.length - 1] = last.content[last.content.length - 1] + text
return
}


last.content || (last.content = []);
last.content.push(text);
}
Expand Down

0 comments on commit 8e64082

Please sign in to comment.