Skip to main content

Module links

Module links 

Source
Expand description

Finding the link targets in Markdown, and replacing the ones a resolver has an answer for. Code is left alone: fenced blocks and inline code spans show links as text, and rewriting them would change what they show.

Functionsยง

rewrite_line ๐Ÿ”’
rewrite_links
content with every link target resolve answers for replaced by its answer: inline links and images, [text](target), and reference definitions, [label]: target.
rewrite_reference_definition ๐Ÿ”’
[label]: target at the start of a line, the target rewritten.
target_length ๐Ÿ”’
How much of text, which follows ](, is the target: up to the space before a title or the closing parenthesis, or all of an <โ€ฆ> target.