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 '>' in element content #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Matthew-Kilpatrick
Copy link

This pull request fixes some cases where the HTML file is parsed incorrectly when there is a greater than symbol inside of an element content, such as a script tag, as reported in issue #21 .

For example, for the following (simple) input: <script>var isBigger = 2 > 1 ? 'yes' : 'no'</script>

When parsed using the current code in this repository, the result is: <script>var isBigger = 2 </script>

And with this PR, the result is: <script>var isBigger = 2 > 1 ? 'yes' : 'no'</script>

I've also modified the sample HTML in the tests directory to include an example of this behaviour.

I've used diff to compare the output of the compile test before and after this modification, and nothing other than the intended chances is modified. I can't see a reason why this fix would cause issues to anything else, though am happy to fix my code if anyone can see any potential issues.

Fix contnet of element body being truncated after first occurrence
of a greater than sign (>), which can cause issues in some circumstances,
such as a conditional evaluation inside a script tag.

Relates to issue jenstornell#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant