Raw HTML #
The tag grammar of CommonMark §6.6, which is shared by raw inline HTML and the start condition of complete-tag HTML blocks, and the kinds of HTML block of CommonMark §4.6 with their end conditions.
Tags #
The closing delimiter of a comment, a processing instruction, a CDATA section, or a declaration.
- comment : HtmlCloser
--> - processingInstruction : HtmlCloser
?> - cdata : HtmlCloser
]]> - declaration : HtmlCloser
>
Instances For
For each closer, the start of the first search for it that reached the end of the input without finding it. A search that starts at or after that position fails without reading the input.
The start of the first failed search for
-->.The start of the first failed search for
?>.The start of the first failed search for
]]>.The start of the first failed search for
>.
Instances For
The monad for parsing raw HTML whose closers are searched for.
Equations
Instances For
The value of x?, or failure when it is none.
Equations
- Lean.Markdown.HtmlM.ofOption x? = OptionT.mk (pure x?)
Instances For
Parses an HTML open tag after its < at cur, which must point at an ASCII letter. After the <,
the tag consists of the tag name, attributes, optional whitespace, an optional /, and >. Each
attribute is preceded by whitespace.
Returns the cursor after the >.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parses an HTML closing tag after its </ at cur. After the </, the tag consists of the tag
name, optional whitespace, and >. Returns the cursor after the >.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parses a processing instruction after its <? at cur, through the first ?>.
Equations
Instances For
Parses a comment, a CDATA section, or a declaration after its <! at cur.
Equations
- One or more equations did not get rendered due to their size.
Instances For
HTML Blocks (CommonMark §4.6) #
Whether text begins with needle. With ignoreCase, ASCII letters of the text match needle's
letters in either case, so needle should be lowercase.
Equations
- Lean.Markdown.startsWithAscii text needle ignoreCase = (Lean.Markdown.matchAscii?✝ text text.startInclusive needle ignoreCase).isSome
Instances For
Whether the tag name name is, case-insensitively, one of the raw text elements pre, script,
style, and textarea, whose HTML blocks end at an end tag.
Equations
Instances For
Whether the tag name name is, case-insensitively, one of the blockTagNames.
Equations
- Lean.Markdown.isBlockTagName name = Lean.Markdown.blockTagNames✝.any fun (x : String) => Lean.Markdown.equalsAscii✝ name x true
Instances For
Parses a complete HTML open or closing tag after its < at cur, followed by nothing but spaces
and tabs, which is the start condition of a complete-tag HTML block (CommonMark §4.6, start
condition 7). Returns the cursor at the end of the input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The kind of an HTML block (CommonMark §4.6). The kind is determined by the start condition that the block's first line meets and selects the block's end condition.
- rawText : HtmlBlockKind
A
pre,script,style, ortextareaelement. The block ends at a line that contains an end tag of any of these elements. - comment : HtmlBlockKind
A comment. The block ends at a line that contains
-->. - processingInstruction : HtmlBlockKind
A processing instruction. The block ends at a line that contains
?>. - declaration : HtmlBlockKind
A declaration. The block ends at a line that contains
>. - cdata : HtmlBlockKind
A CDATA section. The block ends at a line that contains
]]>. - blockTag : HtmlBlockKind
An open or closing tag of a block-level element. The block ends before a blank line.
- completeTag : HtmlBlockKind
A complete open or closing tag alone on its line. The block ends before a blank line.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Markdown.instBEqHtmlBlockKind.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
Equations
Whether a block of this kind ends before a blank line, instead of at a line that contains an end marker.
Equations
Instances For
Whether the first line of a block of this kind may interrupt a paragraph.
Equations
Instances For
Whether line contains the end marker of a block of this kind, which makes the line the block's
last. Kinds that end before a blank line don't have an end marker.
Equations
- Lean.Markdown.HtmlBlockKind.rawText.endConditionMet line = ["</pre>", "</script>", "</style>", "</textarea>"].any fun (endTag : String) => Lean.Markdown.containsAscii✝ line endTag true
- Lean.Markdown.HtmlBlockKind.comment.endConditionMet line = Lean.Markdown.containsAscii✝ line "-->"
- Lean.Markdown.HtmlBlockKind.processingInstruction.endConditionMet line = Lean.Markdown.containsAscii✝ line "?>"
- Lean.Markdown.HtmlBlockKind.declaration.endConditionMet line = Lean.Markdown.containsAscii✝ line ">"
- Lean.Markdown.HtmlBlockKind.cdata.endConditionMet line = Lean.Markdown.containsAscii✝ line "]]>"
- Lean.Markdown.HtmlBlockKind.blockTag.endConditionMet line = false
- Lean.Markdown.HtmlBlockKind.completeTag.endConditionMet line = false