These span tokens are defined in the CommonMark specification.
Token
Description
Example
RawText
any inline text
any text
EscapeSequence
escaped symbols (to avoid them being interpreted as other syntax elements)
\*
LineBreak
Soft or hard (ends with spaces or backslash)
A hard break\
Strong
bold text
**strong**
Emphasis
italic text
*emphasis*
InlineCode
literal text
`a=1`
AutoLink
link that is shown in final output
<https://www.google.com>
Link
Reference a target or LinkDefinition
LinkDefinition
[text](target "title") or [text][key] or [key]
Image
link to an image

HTMLSpan
any valid HTML (rendered in HTML output only)
<p>some text</p>
This is a special token that runs a nested parse of the inline string and extracts nested tokens.
mistletoe.span_tokens.
CoreTokens
Bases: mistletoe.base_elements.SpanToken
mistletoe.base_elements.SpanToken
Raw text. A leaf node.
RawText is the only token that accepts a string for its read method, instead of a match object. Also, all recursions should bottom out here.
content (bool) – raw string content of the token
position (mistletoe.base_elements.Position) – Line position in source text (default: None)
Escape sequences. (“\*”)
This should be set first in the token parse list.
children (list) – a single RawText node for alternative text.
pattern
parse_inner
parse_group
Hard or soft line breaks.
content (bool) – raw content. (default: “”)
soft (bool) – if the break is soft or hard.
Strong tokens: **some text** or __some text__, read in CoreTokens.read
content – raw string content of the token
children – list of child tokens
Emphasis tokens *some text* or _some text_, read in CoreTokens.read
Inline code tokens: `some code`, read in CoreTokens.read
Link tokens, with inline targets: “[name](target)”, read in CoreTokens.read
target (str) – link target
title (str) – link title (default: None)
children (list) – link text. (default: Factory(factory=<class ‘list’>, takes_self=False))
Autolink tokens. (“<http://www.google.com>”)
mailto (bool) – if the link is an email (default: False)
Image tokens, with inline targets: “”, read in CoreTokens.read
src (str) – image source
title (str) – image title (default: None)
children (list) – alternative text. (default: Factory(factory=<class ‘list’>, takes_self=False))
Span-level HTML tokens.