-
Notifications
You must be signed in to change notification settings - Fork 2
Method parse
Brad Sharp edited this page Jan 17, 2021
·
1 revision
Type: iterator Markdown.parse(string document)
Used to parse a markdown document. The iterator returned provides the BlockType and information about the text that is in that block.
for blockType, block in Markdown.parse(md) do
if blockType == BlockType.Heading then
createHeading(block.Text)
elseif blockType == BlockType.Paragraph then
createParagraph(block.Text)
elseif blockType == BlockType.Code then
createCode(block.Syntax, block.Code)
else
...
end
endFor each block type, a table of information is returned. That information is as follows:
Never returned by the iterator
{
int: Indent
string: Text
}
{
int: Indent
int: Level
string: Text
}
{
int: Indent
string: Syntax
string: Code
}
{
int: Indent
list<string>: Lines
}
{
int: Indent
}
{
int: Indent
iterator: Iterator (Allows the quote to be iterated and rendered)
string: RawText
}