Module full_link

Source
Expand description

Structure similar to [link](<to> "stuff") with a configurable prefix.

There are two structures in CommonMark that match this syntax:

  • links - [text](<href> "title")
  • images - ![alt](<src> "title")

You can add custom rules like ~[foo](<bar> "baz"). Let us know if you come up with a fun use case to add as an example!

Add a custom structure by using add_prefix function, which takes the following arguments:

  • PREFIX - marker character before label (! in case of images)
  • ENABLE_NESTED - allow nested links inside
  • md - parser instance
  • f - function that should return your custom Node given href and title

Structs§

ParseLinkFragmentResult

Functions§

add
adds custom rule with no prefix
add_prefix
adds custom rule with the given PREFIX character
parse_link_destination
Helper function used to parse <href> part of the links with optional brackets.
parse_link_title
Helper function used to parse "title" part of the links (with 'title' or (title) alternative syntax).