Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
fix: Added catch for ampersands in interjections. (#48)
Browse files Browse the repository at this point in the history
fixes #47
  • Loading branch information
joseifert committed Oct 8, 2019
1 parent 3adf414 commit e01e165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/litexa/src/parser/litexa.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -2605,9 +2605,15 @@ TemplateStringFontSize

TemplateStringInterjectionPart
= '<!' __ text:TagText '>' __ punctuation:TagPunctuation {
if (text.includes('&')) {
throw new ParserError(location(), `Interjection <!${text}> contains an invalid ampersand character.`);
}
return new lib.TagPart(skill, location(), '!', text + punctuation );
}
/ '<!' __ text:TagText '>' {
if (text.includes('&')) {
throw new ParserError(location(), `Interjection <!${text}> contains an invalid ampersand character.`);
}
return new lib.TagPart(skill, location(), '!', text );
}

Expand Down
4 changes: 2 additions & 2 deletions packages/litexa/src/parser/litexa.pegjs.cached

Large diffs are not rendered by default.

0 comments on commit e01e165

Please sign in to comment.