Enum mini_markdown::lexer::Token
source · pub enum Token<'a> {
Show 22 variants
Plaintext(String),
Header(usize, String, Option<String>),
UnorderedListEntry(Vec<Token<'a>>),
OrderedListEntry(String),
Italic(String),
Bold(String),
BoldItalic(String),
LineBreak,
Newline,
HorizontalRule,
Tab,
DoubleTab,
Strikethrough(String),
Code(String),
CodeBlock(String, String),
BlockQuote(u8, String),
Image(String, Option<String>),
Link(ValidURL<'a>, Option<String>, Option<String>),
Detail(String, Vec<Token<'a>>),
Table(Vec<(Alignment, String)>, Vec<Vec<(Alignment, Vec<Token<'a>>)>>),
TaskListItem(TaskBox, String),
Footnote(String, String),
}
Expand description
Tokens are the intermediate representation format in the markdown to html conversion
Variants§
Plaintext(String)
String: Body of unstructured text
Header(usize, String, Option<String>)
u8: Header level (1..=6). str: Header text. Option
UnorderedListEntry(Vec<Token<'a>>)
str: Text for list entry
OrderedListEntry(String)
str: Text for list entry
Italic(String)
str: Text to be italicized
Bold(String)
str: Text to be bolded
BoldItalic(String)
str: Text to be bolded and italicized
LineBreak
Corresponds to a html tag
Newline
Corresponds to a newline character
HorizontalRule
Corresponds to a
html tag
Tab
Used for control flow. Not directly rendered
DoubleTab
Used for control flow. Not directly rendered
Strikethrough(String)
str: Text to be struck through
Code(String)
str: Text to be placed within an inline code tag. eg. str
CodeBlock(String, String)
First str: Text to be placed within a multi-line code tag. Second str: Language
BlockQuote(u8, String)
u8: Block quote level. str: Block quote text
Image(String, Option<String>)
str: Link. Option
Link(ValidURL<'a>, Option<String>, Option<String>)
str: Link. First Option
Detail(String, Vec<Token<'a>>)
str: Summary. Vec
Table(Vec<(Alignment, String)>, Vec<Vec<(Alignment, Vec<Token<'a>>)>>)
Tuple of Vec<(Alignment, str)>: Which defines the table header and Vec<Vec<(Alignment, Vec
TaskListItem(TaskBox, String)
TaskBox: Boolean state of the checked or unchecked box. str: List item text
Footnote(String, String)
First str: Reference id. Second str: Reference text