package cmarkit

  1. Overview
  2. Docs

Module Cmarkit.Block_lineSource

Block lines.

In CommonMark blocks, a "line" does not necessarily correspond to a line in the source plain text. For example the lines of a paragraph in a block quote are the lines stripped from the block quote markers. We call the line resulting from stripping the block structure preceeding a given block a block line.

Lines

Sourcetype t = string node

The type for block lines.

Sourceval to_string : t -> string

to_string l is (fst l).

Sourceval list_textloc : t list -> Textloc.t

list_textloc ls is a text location spanning the lines ls This is Textloc.none on [].

Sourceval list_of_string : ?meta:Meta.t -> string -> t list

list_of_string s cuts s on newlines. meta is used for all nodes, default to Meta.none.

Tight lines

Sourcetype tight = Layout.blanks * t

The type for tight block lines. A block line with its initial blanks trimmed but kept for layout.

Sourceval tight_to_string : tight -> string

tight_to_string l is (fst (snd l)).

Sourceval tight_list_textloc : tight list -> Textloc.t

tigh_list_textloc ls is a text location spanning the lines ls This is Textloc.none on [].

Sourceval tight_list_of_string : ?meta:Meta.t -> string -> tight list

list_of_string s cuts s on newlines and computes the blanks (except on the first line where they are part of the data). meta is used for all nodes, default to Meta.none.

Blank lines

The type for blank block lines.