Skip to content

Commit 2225813

Browse files
committed
fix position matching for closing angle bracket to avoid potential match inside string attribute or arg to helper in MustacheStatement node
1 parent d6608bf commit 2225813

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parse-result.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ export default class ParseResult {
513513
blockParamsEndIndex + 1
514514
);
515515

516-
const closeOpenIndex = nodeInfo.source.indexOf(selfClosing ? '/>' : '>');
516+
// Match closing index after start of block params to avoid closing tag if /> or > encountered in string
517+
const closeOpenIndex =
518+
nodeInfo.source.substring(blockParamStartIndex).indexOf(selfClosing ? '/>' : '>') +
519+
blockParamStartIndex;
517520
postBlockParamsWhitespace = nodeInfo.source.substring(
518521
blockParamsEndIndex + 1,
519522
closeOpenIndex

0 commit comments

Comments
 (0)