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

Character reference being detected in code block #2732

Closed
backkem opened this issue Dec 9, 2023 · 1 comment
Closed

Character reference being detected in code block #2732

backkem opened this issue Dec 9, 2023 · 1 comment

Comments

@backkem
Copy link

backkem commented Dec 9, 2023

I have a build failing on a file that didn't change:

It seems the piece of code &result is being interpreted as a HTML Character reference. I wonder if this may be a regression or if I should somehow escape this character instead.

@tabatkins
Copy link
Collaborator

tabatkins commented Dec 12, 2023

That error is correct - that's technically a parse error in HTML.

(Bikeshed is slightly more strict than HTML itself here; in HTML, if the &foo isn't actually on the list of char ref names, it's technically valid in HTML. That's a really fragile sort of error, given the sheer size and unpredictability of that list, and the fact that prefixes count (like, &copyright is caught because "copy" is on the list, generating a parse error and the text "©right"). In your case, result doesn't actually have a prefix on the list (closest is "Re"). So Bikeshed errs slightly stricter, but much more predictably, and flags anything which looks like a character reference.)

Yeah, you can either escape the ampersand (&) or switch your pre to xmp (tho that won't work in your case, since you have markup there).

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

No branches or pull requests

2 participants