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
Short syntax for number identifier doesn't work ([span]{#1010}) #5415
Comments
Note that the header case does not work completely either. it seems that the number identifier is being mixed with auto identifiers |
This was implemented like this on purpose, probably since in HTML4 ids couldn't start with a number. We could change this now, at the risk of increasing the chance of false positives slightly, and potentially breaking a few old documents... given the fact that you can use the mentioned workaround, I'm not sure it's worth it, but why not. @agusmba The link URLs are a different case... but the attributes are simply not recognised as attributes... |
It was intentional. If we want to keep this behavior, we should at least document it. A case could be made for allowing identifiers that don't start with letters, but there may be reasons besides HTML4 for requiring the letter. (For example, what about labels in LaTeX?) On the other hand, one could argue that this should be handled by the writer. |
Please, consider that XML doesn’t seem to allow digits as first character to an ID value. |
I encountered this and prefixed all div IDs with a letter to produce usable output. Even with the workaround it is still loses the "data-" prefix. There is "--id-prefix=STRING" for "md-->html". I propose making a similar option available for "html-->md". |
We want to produce HTML5 that is also valid XML (for EPUB3 among other things), so that is a good reason to keep the first-letter restriction. @cactrot your issue is different. Apparently pandoc is converting |
Never mind @cactrot, I'll just fix that issue now. |
And similarly don't parse any `data-X` as `X` when `X` is a valid HTML attribute. Reported in comment on #5415.
Thank you kind sir! Just saw the commit land in the main repo. |
Doesn't work (try):
This works (try):
The text was updated successfully, but these errors were encountered: