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

Script content affects parsing #13

Closed
yurtsiv opened this issue Jun 24, 2024 · 2 comments
Closed

Script content affects parsing #13

yurtsiv opened this issue Jun 24, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@yurtsiv
Copy link

yurtsiv commented Jun 24, 2024

The following HTML

<script type="text/javascript">
   1 < 2
</script>

<div>Test</div>

is incorrectly parsed into

_VDocumentFragment "                                                                                                                                                                                        
   <script type="text/javascript">                                                                                                                                                                              
      1 <div>Test</div>                                                                                                                                                                                                                                                                                                                                                                                                  
   </script>"

When < is removed from the JS snippet it parses fine.

I know your parser is minimalistic and doesn't aim for completeness, but would it be possible to treat script content as text and not try to detect HTML tags in there?

@holtwick holtwick self-assigned this Jun 24, 2024
@holtwick holtwick added the bug Something isn't working label Jun 24, 2024
@holtwick
Copy link
Owner

Sure, good idea. I guess the same will be true for <style>.

Anyway, cannot promise to solve it too soon, but it is now on my list :)

@holtwick
Copy link
Owner

Sorry for the late fix, but with some help from Copilot this was quickly done then ;)

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

No branches or pull requests

2 participants