-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
It would be nice if there was an easy way to have a function resolve link references that haven't been registered (similar to pulldown-cmark https://docs.rs/pulldown-cmark/0.13.1/pulldown_cmark/struct.Parser.html#method.new_with_broken_link_callback).
So we can programmatically decide the href of something like this:
[broken_link]I didn't find anything in the documentation describing how to properly do this, and the only work around I found was to copy and paste the link function in rules_inline (
| def link(state: StateInline, silent: bool) -> bool: |
parseReference is true to put some custom logic to try to resolve the reference.And then register this rule with:
md = markdown_it.MarkdownIt()
def custom_link(state, silent):
....
md.inline.ruler.disable("link")
md.inline.ruler.push("custom_link", custom_link)It would be very nice if there was some blessed route to be able to do this.
Proposal
No response
Tasks and updates
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request