Module Cmarkit_match

US-ASCII and CommonMark construct string matching.

UTF-8 cleanup and US-ASCII matching

val cleanup_utf_8 : string -> string

cleanup_utf_8 s replaces U+0000 and UTF-8 decode errors by Uchar.rep.

module Ascii : sig ... end

US-ASCII matching.

Return data types

type lineno = int

The type for line numbers.

type indent = int

The type for indentation magnitude.

type first = int

The type for the first first byte position of a parsed construct.

type last = int

The type for the last byte position of a parsed construct.

type next = int

The type for a byte position after a parsed construct. The byte position may be invalid (end of input range).

Blocks

val indent : string -> first:int -> last:int -> indent * next
val block_quote_marker : string -> first:int -> last:int -> int option
val blank_line : string -> first:int -> last:int -> bool
val thematic_break : string -> first:int -> last:int -> (int * int) option
val atx_heading : string -> first:int -> last:int -> (int * int * int * int * int) option
val setext_heading : string -> first:int -> last:int -> (int * int * int) option
val indented_code : string -> starting:bool -> first:int -> last:int -> bool
val fenced_code_block_start : string -> first:int -> last:int -> (int * int * int * int) option
val fenced_code_block_continue : string -> open':(int * char * int) -> first:int -> last:int -> [ `Close of int * int | `Line of int * int ]
val could_be_reference_definition : string -> first:int -> last:int -> bool

Blanks and breaks

val skip_blanks : string -> first:int -> last:int -> next
val rev_skip_blanks : string -> first:int -> int -> next
val soft_or_hard_break : string -> first:int -> last:int -> (bool * int * int * next) option

Inlines

val entity : string -> first:int -> last:int -> ([ `Numeric of [ `Dec | `Hex ] * Stdlib.Uchar.t | `Name of string ] * next) option
type backtick_string_index
val code_span : backtick_string_index option -> string -> line:lineno -> first:int -> last:int -> [ `None of backtick_string_index option | `Some of backtick_string_index option * string * int * lineno * int ]

inline Raw HTML and HTML blocks

val raw_html : string -> line:lineno -> first:int -> last:int -> (lineno * int) option
type html_block_end_cond = [
  1. | `End_str of string
  2. | `End_cond_1
  3. | `End_blank
]
val html_block_start : string -> first:int -> last:int -> html_block_end_cond option
val html_block_end : string -> end_cond:html_block_end_cond -> first:int -> last:int -> bool