You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow setting a custom LinkReferenceDefinitions in Parser.Builder #285
An application employing Markdown may want to resolve "naked links" ([foo]) -- i.e. links with no inline destination -- based on contextual knowledge rather than definitions in the text. A custom LinkReferenceDefinition would allow for that.
Hmm that's an interesting idea. So you would set all the known LinkReferenceDefinition in the parser builder beforehand? I wonder if it would be even more useful to provide a callback instead, then you'd have more flexibility and e.g. be able to only look up a definition for which there were actual references in the document.
Activity
robinst commentedon Feb 11, 2024
Hmm that's an interesting idea. So you would set all the known
LinkReferenceDefinitionin the parser builder beforehand? I wonder if it would be even more useful to provide a callback instead, then you'd have more flexibility and e.g. be able to only look up a definition for which there were actual references in the document.Something like:
robinst commentedon Sep 18, 2024
This is now possible with the new
linkProcessorAPI that can be set inParser.Builder, with version 0.23.0! See full release notes here: https://github.com/commonmark/commonmark-java/blob/main/CHANGELOG.md#0230---2024-09-16