-
Notifications
You must be signed in to change notification settings - Fork 195
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
Length limit for cross reference targets #181
Comments
This is the link to the actual regex used: https://github.com/executablebooks/markdown-it-py/blob/c5f46e4bd95415d3b8483b3fa55c06318b25da71/markdown_it/extensions/myst_blocks/index.py#L8 I put the 36 character limit it for performance reasons, but can certainly extend it and document. It will still "fail silently" though, because it's not a failure in the parsers eyes; it just didn't match the regex. Would 72 be ok, surely not longer 😬 |
Does the performance really suffer if you leave it unlimited? |
Maybe not, but I'd prefer to keep a limit: 256 is my final offer 😉 |
@asmeurer can you share the use-case you've got where you need such long refs? Are you including entire file paths in the ref or something? |
With recommonmark I was using direct refs like |
Ok so in markdown-it-py 0.4.8 (just released) I've increased the limit to 100, so hopefully that helps you out 😄 |
closed by #449 |
There seems to be an undocumented length limit for cross reference targets. If I have something like
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)= # Header
where there are 36
a
s, It works fine, but if I instead have(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)= # Header
(37
a
s). Then it silently doesn't read(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)=
as a cross-reference target and just inserts it literally into the document.Ideally I would prefer no length limit, since I like to make the cross reference target name match the header name, which can be longer than 36 characters, but if there is one, it ought to be documented somewhere, and ideally, give an error rather than just silently not parsing.
The text was updated successfully, but these errors were encountered: