-
Notifications
You must be signed in to change notification settings - Fork 624
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
html: apostrophe in JavaScript comment breaks guest parser #3581
Comments
Thank you. Reproduced. I found some variants:
|
Do you know HTML well? If it is not allowed, the next patch may mitigate this issue:
|
Close universal-ctags#3581. MORE DESCRIPTIONS ARE NEEDED. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Newlines are not permitted in JavaScript strings |
As jafl said, newlines aren't permitted in var hello = `
world
` I know you didn't ask specifically about backticks, but I built and tested #3585 with some multiline backtick strings as well and it seemed to work just fine for me. |
I'm talking about HTML. |
Ah ok, it seemed like you were asking about strings in JS in HTML. In HTML you can do things like this and the browser will accept it: <h1 class="
bar
baz
qux:quxx
">Foo</h1> Is this what you wanted to know? |
@polyscone, Yes. Thank you. It is what I would like to know. |
I found variants:
|
The original code used a html-aware tokenizer for reading tokens in <script>...</script> areas. As reported in universal-ctags#3581 and universal-ctags#3597, this original code could not recognize <script>...</script> areas in some cases. This change introduces a tokenizer specialized to script areas in addition to the original html-aware tokenizer. Close universal-ctags#3581. Close universal-ctags#3597. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
The original code used a html-aware tokenizer for reading tokens in <script>...</script> areas. As reported in universal-ctags#3581 and universal-ctags#3597, this original code could not recognize <script>...</script> areas in some cases. This change introduces a tokenizer specialized to script areas in addition to the original html-aware tokenizer. Close universal-ctags#3581. Close universal-ctags#3597. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
The name of the parser:
JavaScript as a guest parser in HTML.
The command line you used to run ctags:
The content of input file:
The tags output you are not satisfied with:
The tags output you expect:
The version of ctags:
How do you get ctags binary:
Win32 binary taken from Universal-ctags/ctags-win32 project.
Extra details:
The tags are correctly generated when using the following input in a
.js
file:The tags are only not generated in full when the JavaScript parser would run as a guest inside the HTML one.
If I remove the apostrophe from the word "don't" in the JavaScript comment then tags are generated in full as expected.
The text was updated successfully, but these errors were encountered: