HTML non-standard nested language #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I tried to use nested language on a custom HTML tag, which the parser throw error when tag is incomplete.
Related code:
github.com/lezer-parser/html@c95b9713f3/src/content.js (L56-L64)mj-style custom tag. I have registered
mj-styleas one of extra tags, then in nested language we ask lezer/html to use CSS parser if it ismj-styletag.The error is:
Invalid inner parse ranges given: [{"from":36,"to":36}]It happen on following line.
The way to fix I believe there are two ways.
from === to, then the code should return null.After more testing, here are the secnarios.
<mj-style>no error<mj-styleerror<mj-style> code </>no error<mj-style>code </mj-st>no errorAttached patch should help—it makes sure the logic doesn't create an inner parse when there is no content to parse.
Thanks for fast patch 😄