Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing error when in-tag string content contains > #996

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

rgallagherab
Copy link
Contributor

@rgallagherab rgallagherab commented Jul 18, 2024

Resolves an issue where an ElementNode with block params can be prematurely terminated if a right angle bracket (>) is included in a string before the true closing bracket.

fixes #995

@@ -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
Copy link
Contributor Author

@rgallagherab rgallagherab Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that since this is inside of an if statement for when block params are present we can trust that the closing bracket will never be before the starting index of the block param and any strings for attributes or helper args will always be before this index.

@bmish bmish added the bug Something isn't working label Jul 24, 2024
@bmish
Copy link
Member

bmish commented Jul 24, 2024

Can you add a descriptive PR title?

@bmish bmish changed the title Issue 995 Fix parsing error when in-tag string content contains > Jul 24, 2024
@bmish bmish merged commit d8c920d into ember-template-lint:master Jul 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angle brackets in helper string argument terminates tag early and duplicates remaining tag text
4 participants