Skip to content

Commit

Permalink
fix: issue with not starting text after < in parsed text mode
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Mar 1, 2022
1 parent 631da3a commit f5ffc83
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/states/PARSED_TEXT_CONTENT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export const PARSED_TEXT_CONTENT: StateDefinition<ParsedTextContentMeta> = {
char(code) {
switch (code) {
case CODE.OPEN_ANGLE_BRACKET:
if (!this.isConcise) {
STATE.checkForClosingTag(this) || STATE.checkForCDATA(this);
if (
this.isConcise ||
!(STATE.checkForClosingTag(this) || STATE.checkForCDATA(this))
) {
this.startText();
}
break;
case CODE.FORWARD_SLASH:
Expand Down
5 changes: 5 additions & 0 deletions test/autotest/script-tag-entities/expected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
text:"console.log('<div>Hello "
${"$escapeXml(input.name)"}
text:"</div>');"
</script>
1 change: 1 addition & 0 deletions test/autotest/script-tag-entities/input.htmljs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script>console.log('<div>Hello ${input.name}</div>');</script>

0 comments on commit f5ffc83

Please sign in to comment.