comrak 0.6.2

A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter
Documentation
atx_heading_start = { "#"{1, 6} ~ (" " | "\t" | "\r" | "\n") }

open_code_fence_backtick = _{ open_code_fence_backtick_match ~ (!("`" | "\r" | "\n" | "\x00") ~ ANY)* }
open_code_fence_backtick_match = { "`"{3,} }
open_code_fence_tilde = _{ open_code_fence_tilde_match ~ (!("\r" | "\n" | "\x00") ~ ANY)* }
open_code_fence_tilde_match = { "~"{3,} }
open_code_fence = _{ (open_code_fence_backtick | open_code_fence_tilde) ~ ("\r" | "\n") }

close_code_fence = _{ close_code_fence_match ~ ("\t" | " ")* ~ ("\r" | "\n") }
close_code_fence_match = { "`"{3,} | "~"{3,} }

html_block_start_1 = { "<" ~ ("script" | "pre" | "style") ~ (" " | "\t" | "\x0b" | "\x0c" | "\r" | "\n" | ">") }
html_block_start_4 = { "<!" ~ 'A'..'Z' }
html_block_start_6 = { "<" ~ "/"? ~ ("address" | "article" | "aside" | "base" | "basefont" | "blockquote" | "body" | "caption" | "center" | "col" | "colgroup" | "dd" | "details" | "dialog" | "dir" | "div" | "dl" | "dt" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hr" | "html" | "iframe" | "legend" | "li" | "link" | "main" | "menu" | "menuitem" | "nav" | "noframes" | "ol" | "optgroup" | "option" | "p" | "param" | "section" | "source" | "title" | "summary" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "ul") ~ (" " | "\t" | "\x0b" | "\x0c" | "\r" | "\n" | "/>" | ">") }

space_char = _{ " " | "\t" | "\x0b" | "\x0c" | "\r" | "\n" }
tag_name = _{ ('A'..'Z' | 'a'..'z') ~ ('A'..'Z' | 'a'..'z' | '0'..'9' | "-")* }
close_tag = _{ "/" ~ tag_name ~ space_char* ~ ">" }
attribute_name = _{ ('a'..'z' | 'A'..'Z' | "_" | ":") ~ ('a'..'z' | 'A'..'Z' | '0'..'9' | ":" | "." | "_" | "-")* }
attribute_value = _{ (!(" " | "\t" | "\r" | "\n" | "\x0b" | "\x0c" | "\"" | "'" | "=" | "<" | ">" | "`" | "\x00") ~ ANY)+ | ("'" ~ (!("'" | "\x00") ~ ANY)* ~ "'") | ("\"" ~ (!("\"" | "\x00") ~ ANY)* ~ "\"") }
attribute_value_spec = _{ space_char* ~ "=" ~ space_char* ~ attribute_value }
attribute = _{ space_char+ ~ attribute_name ~ attribute_value_spec? }
open_tag = _{ tag_name ~ attribute* ~ space_char* ~ "/"? ~ ">" }
html_comment = _{ "!---->" | ("!--" ~ "-"? ~ !("\x00" | ">" | "-") ~ ANY ~ ("-"? ~ !("\x00" | "-") ~ ANY)* ~ "-->") }
processing_instruction = _{ "?" ~ ((!("?" | ">" | "\x00") ~ ANY)+ | "?" ~ !(">" | "\x00") ~ ANY | ">")* ~ "?>" }
declaration = _{ "!" ~ 'A'..'Z'+ ~ space_char+ ~ (!(">" | "\x00") ~ ANY)* ~ ">" }
cdata = _{ "![CDATA[" ~ ((!("]" | "\x00") ~ ANY)+ | "]" ~ (!("]" | "\x00") ~ ANY) | "]]" ~ (!(">" | "\x00") ~ ANY))* ~ "]]>" }
html_tag = { open_tag | close_tag | html_comment | processing_instruction | declaration | cdata }

html_block_start_7 = { "<" ~ (open_tag | close_tag) ~ ("\t" | "\x0c" | " ")* ~ ("\r" | "\n") }

setext_heading_line = { ("="+ | "-"+) ~ (" " | "\t")* ~ ("\r" | "\n") }
thematic_break = { (("*" ~ (" " | "\t")*){3,} | ("_" ~ (" " | "\t")*){3,} | ("-" ~ (" " | "\t")*){3,}) ~ (" " | "\t")* ~ ("\r" | "\n") }

footnote_definition = { "[^" ~ (!("]" | "\r" | "\n" | "\x00" | "\t") ~ ANY)+ ~ "]:" ~ (" " | "\t")* }

scheme = _{ ('A'..'Z' | 'a'..'z') ~ ('A'..'Z' | 'a'..'z' | '0'..'9' | "." | "+" | "-"){1,31} }

scheme_rule = { scheme ~ ":" }

autolink_uri = { scheme ~ ":" ~ (!('\x00'..'\x20' | "<" | ">") ~ ANY)* ~ ">" }
autolink_email = { ('a'..'z' | 'A'..'Z' | '0'..'9' | "." | "!" | "#" | "$" | "%" | "&" | "'" | "*" | "+" | "/" | "=" | "?" | "^" | "_" | "`" | "{" | "|" | "}" | "~" | "-")+ ~ "@" ~ ('a'..'z' | 'A'..'Z' | '0'..'9') ~ (('a'..'z' | 'A'..'Z' | '0'..'9' | "-"){0,61} ~ ('a'..'z' | 'A'..'Z' | '0'..'9')?)? ~ ("." ~ (('a'..'z' | 'A'..'Z' | '0'..'9' | "-"){0,61} ~ ('a'..'z' | 'A'..'Z' | '0'..'9')?)?)* ~ ">" }

spacechars = { space_char+ }

escaped_char = _{ "\\" ~ ANY }
link_title = { "\"" ~ (escaped_char | (!("\"" | "\x00") ~ ANY))* ~ "\"" | "'" ~ (escaped_char | (!("'" | "\x00") ~ ANY))* ~ "'" | "(" ~ (escaped_char | (!("(" | ")" | "\x00") ~ ANY))* ~ ")" }

table_spacechar = _{ " " | "\t" | "\x0b" | "\x0c" }
table_newline = _{ "\r"? ~ "\n" }
table_marker = _{ table_spacechar* ~ ":"? ~ "-"+ ~ ":"? ~ table_spacechar* }
table_cell = { ( escaped_char | !("|" | "\r" | "\n") ~ ANY)* }

table_start = { "|"? ~ table_marker ~ ("|" ~ table_marker)* ~ "|"? ~ table_spacechar* ~ table_newline }
table_cell_end = { "|" ~ table_spacechar* ~ table_newline? }
table_row_end = { table_spacechar* ~ table_newline }

dangerous_url = { "data:" ~ !("png" | "gif" | "jpeg" | "webp") | "javascript:" | "vbscript:" | "file:" }