Tools for parsing and manipulating markdown, including a very basic tokenizer.
Parses and removes any links from the input string
text – An input string which may be a markdown link, either literal or an ID
A tuple of (name, url, id). If the input is not a link, it is returned verbatim as the name.
join(segments: List[str]) → str¶
Joins multiple lines of markdown by adding double newlines between them, or a single newline between list items
segments – A list of strings to join
A joined markdown string
Token(line_no: int, lines: List[str], kind: str)¶
A single tokenized block of markdown, consisting of one or more lines of text.
Which line this block appears on in the original file
The lines of text making up this block
What kind of token this is. One of