Documentation

Lean.Data.Markdown.Parser.Html

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.

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.

    • comment? : Option s.Pos

      The start of the first failed search for -->.

    • processingInstruction? : Option s.Pos

      The start of the first failed search for ?>.

    • cdata? : Option s.Pos

      The start of the first failed search for ]]>.

    • declaration? : Option s.Pos

      The start of the first failed search for >.

    Instances For
      @[reducible, inline]

      The monad for parsing raw HTML whose closers are searched for.

      Equations
      Instances For
        @[inline]
        def Lean.Markdown.HtmlM.ofOption {s : String.Slice} {α : Type} (x? : Option α) :
        HtmlM s α

        The value of x?, or failure when it is none.

        Equations
        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 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) #

                def Lean.Markdown.startsWithAscii {s : String.Slice} (text : s.Subslice) (needle : String) (ignoreCase : Bool := false) :

                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
                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
                    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, or textarea element. 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
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            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