Keeps track of visited tags and provides a lookup for link ids.
Defines a lookup map for link definitions.
A set of tags we have already created.
Succeeds if the given parsers succeeds and the given function is defined at the parse result.
adds the resulting xhtml snippet to the given string builder
Matches exactly one char, no matter which.
Runs the given parser on the given input.
Runs the inline parser on the given input and returns the result
Parses two spaces at the end of a line to a manual break (
Parses an inline code element.
Defines how the output is formatted and whether inline xml elements are allowed.
An image with an explicit path.
Hand rolled parser that parses a chunk of special inline markdown (like links or emphasis) based on a one char lookahead.
Parses emphasized text wrapped in asterisks: *foo*
Parses emphasized text wrapped in underscores: _foo_
Either returns the XML escape sequence for the given char or null.
Escapes the given char for XML.
Escapes the given string so it it can be embedded in xml.
A shortcut markdown link of the form <http://example.com>
A markdown link with the full url given.
Parses an id reference.
Parses either a referenced or a directly defined image.
Parser for inline markdown, always consumes all input, returns the resulting HTML.
A link started by square brackets, either a reference or a a link with the full URL.
Inline markdown in a link.
Looks if the preceding char was one of the given chars.
Parses markdown text up to any of the chars defined in the given map.
Accepts a unix newline and returns a string containing a single newline.
Parses a single inline token.
Matches one of the given char keys in the map.
Matches one of the chars in the given set.
accepts zero or more spaces or tabs returns the matched whitespace
Matches one char in the given range, returns the matched char.
A markdown reference of the form [text][id], [idText] or [idText] Parser returns a tuple with the link definition first and the text to display second.
Parses a referenced image.
Plaintext variant to refInline.
A markdown link which references an url by id.
(Changed in version 2.9.0) The
p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
Matches everything in the parsed string up to the end.
returns the resulting xhtml snippet as a string
Whitespace is sometimes important in markdown parsing, we handle it manually.
Parses a span element like foo or *bar*
Either an emphasis or a strong text wrapped in asterisks.
Parses inline in a span element like bold or emphasis or link up until the given end marker
Either an emphasis or strong text wrapped in underscores.
Chars that may indicate the start of a special Markdown inline sequence.
Chars that may indicate the start of a special markdown inline sequence or the end of a link text.
Parses strong text in asterisks: **foo**
Parses strong text in underscores: foo
A title is everything in quotation marks.
We parse everything as a link/img url until we hit whitespace or a closing brace.
Returns a verbose description of a char (printed char & hex code).
accepts one or more spaces or tabs returns the matched whitespace
Parses an XML Attribute with simplified value handling like xmlAttrVal.
Parses a Simplified xml attribute: everything between quotes ("foo") everything between the quotes is run through the escape handling That way you can omit xml escaping when writing inline XML in markdown.
Parses closing xml tags.
Parses an XML name (tag or attribute name)
Parses an XML name char according to W3C spec except that range #x10000 to #xEFFFF is excluded
Parser for one char that starts an XML name.
Parses an xml start or empty tag, attribute values are escaped.
Parses any xml tag and escapes attribute values.