Explorer

markdown.to-html

description
HTML nodes of a Markdown text (a small subset: headings #, paragraphs, fenced code blocks ```, lists - * 1., tables |, block quotes >, and inline `code`, [text](url) and **bold**). A relative link to a .md file becomes doc_prefix followed by the file name without .md (for docs moved into definy parts). Raw HTML is shown as text
type
Fn(text: String, doc_prefix: String) -> List<@html.node>
expression
fn(text$0, doc_prefix$1) =>
  @markdown.flush(
    state: @core.list-fold(
      T: String,
      A: @markdown.state,
      reducer: fn(acc$2, item$3) =>
        @markdown.line(state: $2, line: $3, doc_prefix: $1),
      init: {blocks: [], block: #none<@markdown.block>},
      xs: @core.string-split(text: $0, separator: "\n")
    ),
    doc_prefix: $1
  ).blocks
visibility
public
markdown.to-html (project markdown, branch main, snapshot A_DQB42norQipCLzT0TSP-ZbZiC-EXHKoYK6tAFWTC0)
id: s2RyEBGSg8lbL5M8P5mWxyIV9uevB3FxPs-PZssnfMc
content hash: FBbrjfhmBOe7I5BdKD0Pp5Wdx7IKVIAQTZPx_o5u-yQ