Skip to content

Commit

Permalink
fix position matching for closing angle bracket to avoid potential ma…
Browse files Browse the repository at this point in the history
…tch inside string attribute or arg to helper in MustacheStatement node
  • Loading branch information
rgallagherab committed Jul 18, 2024
1 parent d6608bf commit 2225813
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parse-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,10 @@ export default class ParseResult {
blockParamsEndIndex + 1
);

const closeOpenIndex = nodeInfo.source.indexOf(selfClosing ? '/>' : '>');
// Match closing index after start of block params to avoid closing tag if /> or > encountered in string
const closeOpenIndex =
nodeInfo.source.substring(blockParamStartIndex).indexOf(selfClosing ? '/>' : '>') +
blockParamStartIndex;
postBlockParamsWhitespace = nodeInfo.source.substring(
blockParamsEndIndex + 1,
closeOpenIndex
Expand Down

0 comments on commit 2225813

Please sign in to comment.