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

removed check op < is first token #2238

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

Conversation

sandy0096
Copy link

@sandy0096 sandy0096 commented Feb 4, 2024

Description

  • Source branch in your fork has meaningful name (not main)

Fixes Issue:

Before Merge Checklist

These items can be completed after PR is created.

(Check any items that are not applicable (NA) for this PR)

  • JavaScript implementation
  • Python implementation (NA if HTML beautifier)
  • [NA] Added Tests to data file(s)
  • [NA] Added command-line option(s) (NA if
  • [NA] README.md documents new feature/option(s)

@sandy0096
Copy link
Author

I ran the prior test cases after the change and all test cases were passed. 60 passing (18ms). Let me know if anything else is required to test.

@bitwiseman
Copy link
Member

This is present to allow there to be an html comment at the top of a javascript <script> element inside an html file. Technically, your change is going in the right direction - html comments should be allowed anywhere inside a <script> element inside an html file. However, it opens up a big can of potential bugs. The tests all pass, but that doesn't mean that no existing code would be broken by this.

At minimum, you need to provide a test case that shows this new functionality working (a test that would fail if run without this change), Preferably, you also add some tests for inputs that are challenging, such as a<!--b?1:0; . This code is unlikely, but not impossible.

For full correctness, what we need is an "templating" called "HTML" that turns on html parsing in JavaScript when inside a <script> element inside an html file. But that is ton more work and I don't expect you to do that.

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.

2 participants