Skip to main content

Module markdown

Module markdown 

Source
Expand description

CommonMark syntax facts every Markdown writer in the family needs.

Each library renders its own document model, and how it styles a run is its own business. Where an emphasis delimiter may stand, and how text the document supplies — a picture’s description, a link’s target — has to be written so that it stays inside the construct it belongs to, are not: they are properties of CommonMark, and a writer that gets them wrong prints its syntax as text. This module answers those questions once so the writers cannot drift on them.

std-only, like the rest of the crate root.

Functions§

code_span
A code span holding text exactly as given: CommonMark reads it back as text, every line ending in it read as one space.
emphasis_span
The part of a styled run that emphasis delimiters (*, **, ~~) can wrap, given the characters the run lands between, or None when no part can.
image
A picture as an inline image: ![alt](destination).
link
An inline link: [label](destination), or [label](destination "title").
link_destination
A link or image destination, written so that CommonMark reads back exactly url (§6.3).