---
name: "lowdown"
section: "3"
platform: "linux"
package: "lowdown"
version: "3.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/lowdown/3"
---

# lowdown(3)

simple markdown translator library

## NAME

**lowdown** – simple markdown translator library

## LIBRARY

library “liblowdown”

## SYNOPSIS

**#include \<sys/queue.h\>**

**#include \<stdio.h\>**

**#include \<lowdown.h\>**

*struct lowdown\_meta* *struct lowdown\_node* *struct lowdown\_opts*

## DESCRIPTION

This library parses [lowdown(5)](/lowdown/5.md) into various output formats.

The library consists first of a high-level interface consisting of [lowdown\_buf(3)](/lowdown_buf/3.md), [lowdown\_buf\_diff(3)](/lowdown_buf_diff/3.md), [lowdown\_file(3)](/lowdown_file/3.md), and [lowdown\_file\_diff(3)](/lowdown_file_diff/3.md).

The high-level functions interface with low-level functions that perform parsing and formatting. These consist of [lowdown\_doc\_new(3)](/lowdown_doc_new/3.md), [lowdown\_doc\_parse(3)](/lowdown_doc_parse/3.md), and [lowdown\_doc\_free(3)](/lowdown_doc_free/3.md) for parsing [lowdown(5)](/lowdown/5.md) documents into an abstract syntax tree.

The front-end functions for freeing, allocation, and rendering are as follows.

- HTML5:

  -

    [lowdown\_html\_free(3)](/lowdown_html_free/3.md)

  -

    [lowdown\_html\_new(3)](/lowdown_html_new/3.md)

  -

    [lowdown\_html\_rndr(3)](/lowdown_html_rndr/3.md)

- gemini:

  -

    [lowdown\_gemini\_free(3)](/lowdown_gemini_free/3.md)

  -

    [lowdown\_gemini\_new(3)](/lowdown_gemini_new/3.md)

  -

    [lowdown\_gemini\_rndr(3)](/lowdown_gemini_rndr/3.md)

- LaTeX:

  -

    [lowdown\_latex\_free(3)](/lowdown_latex_free/3.md)

  -

    [lowdown\_latex\_new(3)](/lowdown_latex_new/3.md)

  -

    [lowdown\_latex\_rndr(3)](/lowdown_latex_rndr/3.md)

- OpenDocument:

  -

    [lowdown\_odt\_free(3)](/lowdown_odt_free/3.md)

  -

    [lowdown\_odt\_new(3)](/lowdown_odt_new/3.md)

  -

    [lowdown\_odt\_rndr(3)](/lowdown_odt_rndr/3.md)

- roff:

  -

    [lowdown\_roff\_free(3)](/lowdown_roff_free/3.md)

  -

    [lowdown\_roff\_new(3)](/lowdown_roff_new/3.md)

  -

    [lowdown\_roff\_rndr(3)](/lowdown_roff_rndr/3.md)

- UTF-8 ANSI terminal:

  -

    [lowdown\_term\_free(3)](/lowdown_term_free/3.md)

  -

    [lowdown\_term\_new(3)](/lowdown_term_new/3.md)

  -

    [lowdown\_term\_rndr(3)](/lowdown_term_rndr/3.md)

- debugging:

  -

    [lowdown\_tree\_rndr(3)](/lowdown_tree_rndr/3.md)

To compile and link, use [pkg-config(1)](/pkg-config/1.md):

```
% cc `pkg-config --cflags lowdown` -c -o sample.o sample.c
% cc -o sample sample.o `pkg-config --libs lowdown`
```

### Pledge Promises

The **lowdown** library is built to operate in security-sensitive environments, such as those using pledge(2) on OpenBSD. The only promise required is *stdio* for [lowdown\_file\_diff(3)](/lowdown_file_diff/3.md) and [lowdown\_file(3)](/lowdown_file/3.md): both require access to the stream for reading input.

## TYPES

All **lowdown** functions use one or more of the following structures.

The main structure for configuring parsing and output is *struct* *lowdown\_opts*. It has the following fields:

- *enum* *lowdown\_type* *type*

  The output medium:

  - LOWDOWN\_HTML

    HTML5

  - LOWDOWN\_LATEX

    LaTeX

  - LOWDOWN\_MAN

    roff **-m***an* macros

  - LOWDOWN\_MDOC

    roff **-m***doc* macros

  - LOWDOWN\_FODT

    “flat” OpenDocument

  - LOWDOWN\_TERM

    ANSI-compatible UTF-8 terminal output

  - LOWDOWN\_GEMINI

    Gemini “gemtext” format

  - LOWDOWN\_MS

    roff **-m***s* macros

  - LOWDOWN\_TREE

    syntax tree (debugging)

- *unsigned* *int* *feat*

  Parse-time features. This bit-field may have the following bits OR'd:

  - LOWDOWN\_ATTRS

    Parse PHP extra link, header, and image attributes.

  - LOWDOWN\_AUTOLINK

    Parse http, https, ftp, mailto, and relative links or link fragments.

  - LOWDOWN\_CALLOUTS

    Parse MDN/GFM callouts (“admonitions”).

  - LOWDOWN\_COMMONMARK

    Tighten input parsing to the CommonMark specification. Allows for the following features:

    - Using the first ordered list value instead of starting all lists at one.

    - Lists immediately following paragraphs.

      This feature is *experimental* and *incomplete*.

  - LOWDOWN\_DEFLIST

    Parse PHP extra definition lists. This is currently constrained to single-key lists.

  - LOWDOWN\_FENCED

    Parse GFM fenced (language-specific) code blocks.

  - LOWDOWN\_FOOTNOTES

    Parse MMD style footnotes. This only supports the referenced footnote style, not the “inline” style.

  - LOWDOWN\_HILITE

    Parse highlit sequences. This are disabled by default because it may be erroneously interpreted as section headers.

  - LOWDOWN\_IMG\_EXT

    Deprecated. Use LOWDOWN\_ATTRS instead.

  - LOWDOWN\_MANTITLE

    Recognise manpage titles in Pandoc metadata title lines. Only applicable if LOWDOWN\_METADATA is also provided. Manpages titles must begin with a non-empty title followed by an open parenthesis, digit or “n”, optional letters after, then a closing parenthesis. This may be optionally followed by a source and, if a vertical bar is detected, the content after as the volume. These are passed to the renderers as the title, volume, and optionally source and volume metadata key-value pairs. The original title is not recoverable.

  - LOWDOWN\_MATH

    Parse mathematics equations.

  - LOWDOWN\_METADATA

    Parse in-document metadata.

  - LOWDOWN\_NOCODEIND

    Do not parse indented content as code blocks.

  - LOWDOWN\_NOINTEM

    Do not parse emphasis within words.

  - LOWDOWN\_STRIKE

    Parse strikethrough sequences.

  - LOWDOWN\_SUPER

    Parse super-scripts. This accepts foo^bar^ GFM super-scripts.

  - LOWDOWN\_SUPER\_SHORT

    If LOWDOWN\_SUPER is enabled, instead of the GFM style, accept the “short” form of superscript. This accepts foo^bar, which puts the parts following the caret until whitespace in superscripts; or foo^(bar), which puts only the parts in parenthesis.

  - LOWDOWN\_TABLES

    Parse GFM tables.

  - LOWDOWN\_TASKLIST

    Parse GFM task list items.

- *unsigned* *int* *oflags*

  Output-time features. Bit values are specific to the *type* and are not guaranteed to be globally unique.

  For all types:

  - LOWDOWN\_NOLINK

    Where possible, don't show links at all. Applies to images and regular links: autolinks are still shown. This may be combined with LOWDOWN\_SHORTLINK to also shorten autolinks. Only applies to LOWDOWN\_MAN, LOWDOWN\_MS, and LOWDOWN\_TERM.

  - LOWDOWN\_NORELLINK

    Like LOWDOWN\_NOLINK, but only for relative links.

  - LOWDOWN\_SHORTLINK

    Where possible, render link URLs in short form. Applies to images, autolinks, and regular links. This may be combined with LOWDOWN\_NOLINK to only show shortened autolinks. Only applies to LOWDOWN\_MAN, LOWDOWN\_MS, and LOWDOWN\_TERM.

  - LOWDOWN\_SKIP\_HTML

    Do not render in-document HTML at all. Text within HTML elements remains. Applies to LOWDOWN\_HTML, LOWDOWN\_FODT, LOWDOWN\_LATEX, LOWDOWN\_MAN, and LOWDOWN\_MS.

  - LOWDOWN\_SMARTY

    Don't use smart typography formatting.

  - LOWDOWN\_STANDALONE

    Emit a full document instead of a document fragment. This envelope is largely populated from metadata if LOWDOWN\_METADATA was provided as an option or as given in *meta* or *metaovr*.

    For LOWDOWN\_HTML:

    - LOWDOWN\_HTML\_CALLOUT\_MDN, LOWDOWN\_HTML\_CALLOUT\_GFM

      Output MDN and/or GFM-style callout syntax.

    - LOWDOWN\_HTML\_CUSTOM\_ATTRS

      Output unrecognised HTML attributes as well as recognised. For example rel is a recognised HTML attribute, while data-rel is not.

    - LOWDOWN\_HTML\_ESCAPE

      If LOWDOWN\_SKIP\_HTML has not been set, escapes in-document HTML so that it is rendered as opaque text.

    - LOWDOWN\_HTML\_HARD\_WRAP

      Retain line-breaks within paragraphs.

    - LOWDOWN\_HTML\_HEAD\_IDS

      Have an identifier written with each header element consisting of an HTML-escaped version of the header contents.

    - LOWDOWN\_HTML\_NUM\_ENT

      Convert, when possible, HTML entities to their numeric form. If not set, the entities are used as given in the input.

    - LOWDOWN\_HTML\_OWASP

      When escaping text, be extra paranoid in following the OWASP suggestions for which characters to escape.

    - LOWDOWN\_HTML\_TITLEBLOCK

      Output a Pandoc-style title block. This is a \<header id="title-block-header"\> element right after the opening \<body\> containing elements for specified title, author(s), and date. These are \<h1\> and \<p\> elements, respectively, with classes set to what's being output (title, etc.). At least one of these must be specified for the title block to be output.

      For LOWDOWN\_GEMINI, there are several flags for controlling link placement. By default, links (images, autolinks, and links) are queued when specified in-line then emitted in a block sequence after the nearest block node. (See ABSTRACT SYNTAX TREE.)

      - LOWDOWN\_GEMINI\_LINK\_END

        Emit the queue of links at the end of the document instead of after the nearest block node.

      - LOWDOWN\_GEMINI\_LINK\_IN

        Render all links within the flow of text. This will cause breakage when nested links, such as images within links, links in blockquotes, etc. It should not be used unless in carefully crafted documents.

      - LOWDOWN\_GEMINI\_LINK\_NOREF

        Do not format link labels. Takes precedence over LOWDOWN\_GEMINI\_LINK\_ROMAN.

      - LOWDOWN\_GEMINI\_LINK\_ROMAN

        When formatting link labels, use lower-case Roman numerals instead of the default lowercase hexavigesimal (i.e., “a”, “b”, ..., “aa”, “ab”, ...).

      - LOWDOWN\_GEMINI\_METADATA

        Print metadata as the canonicalised key followed by a colon then the value, each on one line (newlines replaced by spaces). The metadata block is terminated by a double newline. If there is no metadata, this does nothing.

        There may only be one of LOWDOWN\_GEMINI\_LINK\_END or LOWDOWN\_GEMINI\_LINK\_IN. If both are specified, the latter is unset.

        For LOWDOWN\_FODT, there are no specific flags.

        For LOWDOWN\_LATEX:

        - LOWDOWN\_LATEX\_NUMBERED

          Use the default numbering scheme for sections, subsections, etc. If not specified, these are inhibited.

          For LOWDOWN\_MAN, LOWDOWN\_MDOC, and LOWDOWN\_MS:

          - LOWDOWN\_ROFF\_GROFF

            Use GNU extensions (i.e., for [groff(1)](/groff/1.md)) when rendering output. The groff arguments must include **-m***pdfmark* for formatting links with LOWDOWN\_MAN or **-m***spdf* instead of **-m***s* for LOWDOWN\_MS. Applies to the LOWDOWN\_MAN and LOWDOWN\_MS output types.

          - LOWDOWN\_ROFF\_NUMBERED

            Use numbered sections if LOWDOWON\_ROFF\_GROFF is not specified. Only applies to the LOWDOWN\_MS output type.

          - LOWDOWN\_ROFF\_MANPAGE

            For LOWDOWN\_MAN and LOWDOWN\_MDOC, re-format the NAME, SYNOPSIS and SEE ALSO sections to conform to the proper macros for those sections. Also interpret font spans in other sections to be manpage-specific, such as command flags and arguments (when in a command manual section) or variables and functions (a function manual section).

          - LOWDOWN\_ROFF\_ENDNOTES

            For LOWDOWN\_MS, use endnotes instead of footnotes.

            For LOWDOWN\_TERM:

            - LOWDOWN\_TERM\_ALL\_META

              If LOWDOWN\_STANDALONE is specified, output all metadata instead of just the title, author, and date.

            - LOWDOWN\_TERM\_NOANSI

              Don't apply ANSI style codes at all. Use backspace encoding instead for bold/underline. This implies LOWDOWN\_TERM\_NOCOLOUR.

            - LOWDOWN\_TERM\_NOCOLOUR

              Don't apply ANSI colour codes. This will still show underline, bold, etc. This should not be used in difference mode, as the output will make no sense.

            - LOWDOWN\_TERM\_NOSTYLE

              Don't use any escape styles at all. This takes precedence over LOWDOWN\_TERM\_NOANSI.

            - LOWDOWN\_TERM\_NOTABLEWRAP

              Don't wrap table columns to fit the width of the output.

- *size\_t* *maxdepth*

  The maximum parse depth before the parser exits. Most documents will have a parse depth in the single digits.

- *struct* *lowdown\_opts\_nroff* *nroff*

  If *type* is LOWDOWN\_MAN, LOWDOWN\_MDOC, or LOWDOWN\_MS, this contains constant-width font variants: *const char \*cr* for roman constant-width, *const char \*cb* for bold, *const char \*ci* for italic, and *const char \*cbi* for bold-italic. If any of these are NULL, they default to their constant-width variants.

- *struct* *lowdown\_opts\_odt* *odt*

  If *type* is LOWDOWN\_FODT, this contains *const char \*sty*, which is either NULL or the OpenDocument styles used when creating standalone documents. If NULL, the default styles are used.

- *struct* *lowdown\_opts\_term* *term*

  If *type* is LOWDOWN\_TERM, this contains *size\_t cols*, the non-zero number of columns in the terminal; *size\_t width*, the requested content width or zero for auto; *size\_t hmargin*, left-margin width; *size\_t hpadding*, left-padding width eating into *width*; *size\_t vmargin*, the vertical margin in lines; and *int centre* if the content should be centred (*hmargin* is ignored).

- *char* *\*\*meta*

  An array of metadata key-value pairs or NULL. Each pair must appear as if provided on one line (or multiple lines) of the input, including the terminating newline character. If not consisting of a valid pair (e.g., no newline, no colon), then it is ignored. When processed, these values are overridden by those in the document (if LOWDOWN\_METADATA is specified) or by those in *metaovr*.

- *size\_t* *metasz*

  Number of pairs in *metaovr*.

- *char* *\*\*metaovr*

  See *meta*. The difference is that *metaovr* is applied after *meta* and in-document metadata, so it overrides prior values.

- *size\_t* *metaovrsz*

  Number of pairs in *metaovr*.

- *const* *char* *\*templ*

  If LOWDOWN\_STANDALONE is specified, this is set to the external template file or NULL to use internal templating. This is only valid for output media supporting external templates; otherwise, it may be ignored.

Parsed metadata is held in key-value *struct lowdown\_meta* pairs, or collectively as *struct lowdown\_metaq*, if LOWDOWN\_METADATA is set in *feat*. The former structure consists of the following fields:

- *char* *\*key*

  The metadata key in its canonical form: lowercase alphanumerics, hyphen, and underscore. Whitespace is removed and other characters replaced by a question mark.

- *char* *\*value*

  The metadata value. This may be an empty string.

Attributes (including extended attributes) for links, headers, and images are held in key-value *struct lowdown\_attr*, which is always specified as a sized array indexed to the enumeration items in *enum lowdown\_attr\_type*.

- *char* *\*key*

  If not NULL, the attribute key like class or target. This may be zero-length.

- *struct* *lowdown\_buf* *\*value*

  If not NULL, the attribute value. This may be zero-length.

If the array is non-empty, it will contain at least LOWDOWN\_ATTR\_CUSTOM buckets for quick indexing. Including and following the LOWDOWN\_ATTR\_CUSTOM bucket are unindexed (unrecognised) attributes. The bucket is valid if its *value* is not NULL.

The abstract syntax tree is encoded in *struct* *lowdown\_node*, which consists of the following.

- *enum* *lowdown\_rndrt* *type*

  The node type, using HTML5 output as an illustration:

  - LOWDOWN\_BLOCKCODE

    A block-level snippet of code described by \<pre\>\<code\>.

  - LOWDOWN\_BLOCKHTML

    A block-level snippet of HTML. This is simply opaque HTML content.

  - LOWDOWN\_BLOCKQUOTE

    A block-level quotation described by \<blockquote\>.

  - LOWDOWN\_CODESPAN

    An inline-level snippet of code described by \<code\>.

  - LOWDOWN\_DEFINITION

    A definition list described by \<dl\>.

  - LOWDOWN\_DEFINITION\_DATA

    Definition data described by \<dd\>.

  - LOWDOWN\_DEFINITION\_TITLE

    Definition title described by \<dt\>.

  - LOWDOWN\_DOC\_HEADER

    Container for metadata described by \<head\>.

  - LOWDOWN\_DOUBLE\_EMPHASIS

    Bold (or otherwise notable) content described by \<strong\>.

  - LOWDOWN\_EMPHASIS

    Italic (or otherwise notable) content described by \<em\>.

  - LOWDOWN\_ENTITY

    Named or numeric HTML entity.

  - LOWDOWN\_FOOTNOTE

    Footnote content.

  - LOWDOWN\_HEADER

    A block-level header described by one of \<h1\> through \<h6\>.

  - LOWDOWN\_HIGHLIGHT

    Marked test described by \<mark\>.

  - LOWDOWN\_HRULE

    A horizontal line described by \<hr\>.

  - LOWDOWN\_IMAGE

    An image described by \<img\>.

  - LOWDOWN\_LINEBREAK

    A hard line-break within a block context described by \<br\>.

  - LOWDOWN\_LINK

    A link to external media described by \<a\>. Links may contain limited child markup, but not nested links.

  - LOWDOWN\_LINK\_AUTO

    Like LOWDOWN\_LINK, except inferred from text content.

  - LOWDOWN\_LIST

    A list enclosure described by \<ul\> or \<ol\>.

  - LOWDOWN\_LISTITEM

    A list item described by \<li\>.

  - LOWDOWN\_MATH\_BLOCK

    A snippet of mathematical text in LaTeX format described within \\\[xx\\\] or \\(xx\\). This is usually (in HTML) externally handled by a JavaScript renderer.

  - LOWDOWN\_META

    Meta-data keys and values. These are described by elements in \<head\>.

  - LOWDOWN\_NORMAL\_TEXT

    Normal text content.

  - LOWDOWN\_PARAGRAPH

    A block-level paragraph described by \<p\>.

  - LOWDOWN\_RAW\_HTML

    An inline of raw HTML. (Only if configured during parse.)

  - LOWDOWN\_ROOT

    The root of the document. This is always the topmost node, and the only node where the *parent* field is NULL.

  - LOWDOWN\_STRIKETHROUGH

    Content struck through. Described by \<del\>.

  - LOWDOWN\_SUBSCRIPT, LOWDOWN\_SUPERSCRIPT

    A subscript or superscript described by \<sub\> or \<sup\>, respectively.

  - LOWDOWN\_TABLE\_BLOCK

    A table block described by \<table\>.

  - LOWDOWN\_TABLE\_BODY

    A table body section described by \<tbody\>.

  - LOWDOWN\_TABLE\_CELL

    A table cell described by \<td\>, or \<th\> if in the header.

  - LOWDOWN\_TABLE\_HEADER

    A table header section described by \<thead\>.

  - LOWDOWN\_TABLE\_ROW

    A table row described by \<tr\>.

  - LOWDOWN\_TRIPLE\_EMPHASIS

    Combination of LOWDOWN\_EMPHASIS and LOWDOWN\_DOUBLE\_EMPHASIS.

- *size\_t* *id*

  An identifier unique within the document. This can be used as a table index since the number is assigned from a monotonically increasing point during the parse.

- *struct* *lowdown\_node* *\*parent*

  The parent of the node, or NULL at the root.

- *enum* *lowdown\_chng* *chng*

  Change tracking: whether this node was inserted (LOWDOWN\_CHNG\_INSERT), deleted (LOWDOWN\_CHNG\_DELETE), or neither (LOWDOWN\_CHNG\_NONE).

- *struct* *lowdown\_nodeq* *children*

  A possibly-empty list of child nodes.

- *\<anon* *union\>*

  An anonymous union of type-specific structures.

  - *rndr\_autolink*

    For LOWDOWN\_LINK\_AUTO, the link address as *link* and the link type *type*, which may be one of HALINK\_EMAIL for e-mail links and HALINK\_NORMAL otherwise. Any buffer may be empty-sized.

  - *rndr\_blockcode*

    For LOWDOWN\_BLOCKCODE, the opaque *text* of the block and the optional *lang* of the code language.

  - *rndr\_blockhtml*

    For LOWDOWN\_BLOCKHTML, the opaque HTML *text*.

  - *rndr\_codespan*

    The opaque *text* of the contents.

  - *rndr\_definition*

    For LOWDOWN\_DEFINITION, containing *flags* that may be HLIST\_FL\_BLOCK if the definition list should be interpreted as containing block nodes.

  - *rndr\_entity*

    For LOWDOWN\_ENTITY, the entity *text*.

  - *rndr\_header*

    For LOWDOWN\_HEADER, the *level* of the header starting at zero (this value is relative to the metadata base header level, defaulting to one). Arbitrary key-value attributes are stored in *attrs* of length *attrsz*, which are NULL and 0, respectively, if there are no attributes.

  - *rndr\_image*

    For LOWDOWN\_IMAGE, the image address *link*, the image title *title*, dimensions NxN (width by height) in *dims*, and alternate text *alt*. Arbitrary key-value attributes are stored in *attrs* of length *attrsz*, which are NULL and 0, respectively, if there are no attributes.

  - *rndr\_link*

    Like *rndr\_autolink*, but without a type and further defining an optional link title *title*. Arbitrary key-value attributes are stored in *attrs* of length *attrsz*, which are NULL and 0, respectively, if there are no attributes.

  - *rndr\_list*

    For LOWDOWN\_LIST, consists of a bitfield *flags* that may be set to HLIST\_FL\_ORDERED for an ordered list and HLIST\_FL\_UNORDERED for an unordered one. If HLIST\_FL\_BLOCK is set, the list should be output as if items were separate blocks. The *start* value for HLIST\_FL\_ORDERED is the starting list item position, which is one by default and never zero. The *items* is the number of list items.

  - *rndr\_listitem*

    For LOWDOWN\_LISTITEM, consists of a bitfield *flags* that may be set to HLIST\_FL\_ORDERED for an ordered list, HLIST\_FL\_UNORDERED for an unordered list, HLIST\_FL\_DEF for definition list data, HLIST\_FL\_CHECKED or HLIST\_FL\_UNCHECKED for an unordered “task” list, and/or HLIST\_FL\_BLOCK for list item output as if containing block nodes. The HLIST\_FL\_BLOCK should not be used: use the parent list (or definition list) flags for this. The *num* is the index in a HLIST\_FL\_ORDERED list. It is monotonically increasing with each item in the list, starting at the *start* variable given in *struct* *rndr\_list*.

  - *rndr\_math*

    For LOWDOWN\_MATH, the mode of display in *blockmode*: if 1, in-line math; if 2, multi-line. The opaque equation, which is assumed to be in LaTeX format, is in the opaque *text*.

  - *rndr\_meta*

    Each LOWDOWN\_META key-value pair is represented. The keys are lower-case without spaces or non-ASCII characters. If provided, enclosed nodes may consist only of LOWDOWN\_NORMAL\_TEXT and LOWDOWN\_ENTITY.

  - *rndr\_normal\_text*

    The basic *text* content for LOWDOWN\_NORMAL\_TEXT. If *flags* is set to HTEXT\_ESCAPED, the text may be escaped for output, but may not be altered by any smart typography or similar (it should be passed as-is).

  - *rndr\_paragraph*

    For LOWDOWN\_PARAGRAPH, species how many *lines* the paragraph has in the input file and *beoln*, set to non-zero if the paragraph ends with an empty line instead of a breaking block node.

  - *rndr\_raw\_html*

    For LOWDOWN\_RAW\_HTML, the opaque HTML *text*.

  - *rndr\_table*

    For LOWDOWN\_TABLE\_BLOCK, the number of *columns* in each row or header row. The number of columns in *rndr\_table*, *rndr\_table\_header*, and *rndr\_table\_cell* are the same.

  - *rndr\_table\_cell*

    For LOWDOWN\_TABLE\_CELL, the current *col* column number out of *columns*. See *rndr\_table\_header* for a description of the bits in *flags*. The number of columns in *rndr\_table*, *rndr\_table\_header*, and *rndr\_table\_cell* are the same.

  - *rndr\_table\_header*

    For LOWDOWN\_TABLE\_HEADER, the number of *columns* in each row and the per-column *flags*, which may tested for equality against HTBL\_FL\_ALIGN\_LEFT, HTBL\_FL\_ALIGN\_RIGHT, or HTBL\_FL\_ALIGN\_CENTER after being masked with HTBL\_FL\_ALIGNMASK; or HTBL\_FL\_HEADER. If no alignment is specified after the mask, the default should be left-aligned. The number of columns in *rndr\_table*, *rndr\_table\_header*, and *rndr\_table\_cell* are the same.

## ABSTRACT SYNTAX TREE

A parsed document is a tree of *struct* *lowdown\_node* nodes. If a node is “block”, it may contain other block or inline nodes. If “inline,” it may only contain other inline nodes. “Special” nodes are documented below. An additional mark of “void” means that the node will never contain children.

| | |
| --- | --- |
| Node | Scope |
| LOWDOWN\_BLOCKCODE | block, void |
| LOWDOWN\_BLOCKHTML | block, void |
| LOWDOWN\_BLOCKQUOTE | block |
| LOWDOWN\_CODESPAN | inline, void |
| LOWDOWN\_DEFINITION | block |
| LOWDOWN\_DEFINITION\_DATA | special |
| LOWDOWN\_DEFINITION\_TITLE | special |
| LOWDOWN\_DOC\_HEADER | special |
| LOWDOWN\_DOUBLE\_EMPHASIS | inline |
| LOWDOWN\_EMPHASIS | inline |
| LOWDOWN\_ENTITY | inline, void |
| LOWDOWN\_FOOTNOTE | block, special |
| LOWDOWN\_HEADER | block |
| LOWDOWN\_HRULE | inline, void |
| LOWDOWN\_IMAGE | inline, void |
| LOWDOWN\_LINEBREAK | inline, void |
| LOWDOWN\_LINK | inline |
| LOWDOWN\_LINK\_AUTO | inline, void |
| LOWDOWN\_LIST | block |
| LOWDOWN\_LISTITEM | special |
| LOWDOWN\_MATH\_BLOCK | inline, void |
| LOWDOWN\_META | special |
| LOWDOWN\_NORMAL\_TEXT | inline, void |
| LOWDOWN\_PARAGRAPH | block |
| LOWDOWN\_RAW\_HTML | inline, void |
| LOWDOWN\_ROOT | special |
| LOWDOWN\_STRIKETHROUGH | inline |
| LOWDOWN\_SUBSCRIPT | inline |
| LOWDOWN\_SUPERSCRIPT | inline |
| LOWDOWN\_TABLE\_BLOCK | block |
| LOWDOWN\_TABLE\_BODY | special |
| LOWDOWN\_TABLE\_CELL | special |
| LOWDOWN\_TABLE\_HEADER | special |
| LOWDOWN\_TABLE\_ROW | special |
| LOWDOWN\_TRIPLE\_EMPHASIS | inline |

The general structure of the AST is as follows. Nodes have no order imposed on them unless as noted:

- LOWDOWN\_ROOT (ordered)

  - LOWDOWN\_DOC\_HEADER

    - LOWDOWN\_META

      - LOWDOWN\_ENTITY

      - LOWDOWN\_NORMAL\_TEXT

  - (zero or more block nodes)

Special nodes have specific placement within their parents as follows:

- LOWDOWN\_DEFINITION (one or more ordered pairs of...)

  - LOWDOWN\_DEFINITION\_TITLE

    - (inline nodes)

  - LOWDOWN\_DEFINITION\_DATA

    - (block nodes)

- LOWDOWN\_HEADER

  - (inline nodes)

- LOWDOWN\_LIST

  - LOWDOWN\_LISTITEM

    - (inline or block nodes, depending)

- LOWDOWN\_TABLE\_BLOCK (ordered)

  - LOWDOWN\_TABLE\_HEADER (zero or more...)

    - LOWDOWN\_TABLE\_ROW (one or more...)

      - LOWDOWN\_TABLE\_CELL

        - (inline nodes)

  - LOWDOWN\_TABLE\_BODY (zero or more...)

    - LOWDOWN\_TABLE\_ROW (one or more...)

      - LOWDOWN\_TABLE\_CELL

        - (inline nodes)

Lastly, LOWDOWN\_FOOTNOTE may appear anywhere in the document and contains block nodes.

## SEE ALSO

[lowdown(1)](/lowdown/1.md), [lowdown\_buf(3)](/lowdown_buf/3.md), [lowdown\_buf\_diff(3)](/lowdown_buf_diff/3.md), [lowdown\_diff(3)](/lowdown_diff/3.md), [lowdown\_doc\_free(3)](/lowdown_doc_free/3.md), [lowdown\_doc\_new(3)](/lowdown_doc_new/3.md), [lowdown\_doc\_parse(3)](/lowdown_doc_parse/3.md), [lowdown\_file(3)](/lowdown_file/3.md), [lowdown\_file\_diff(3)](/lowdown_file_diff/3.md), [lowdown\_gemini\_free(3)](/lowdown_gemini_free/3.md), [lowdown\_gemini\_new(3)](/lowdown_gemini_new/3.md), [lowdown\_gemini\_rndr(3)](/lowdown_gemini_rndr/3.md), [lowdown\_html\_free(3)](/lowdown_html_free/3.md), [lowdown\_html\_new(3)](/lowdown_html_new/3.md), [lowdown\_html\_rndr(3)](/lowdown_html_rndr/3.md), [lowdown\_latex\_free(3)](/lowdown_latex_free/3.md), [lowdown\_latex\_new(3)](/lowdown_latex_new/3.md), [lowdown\_latex\_rndr(3)](/lowdown_latex_rndr/3.md), [lowdown\_metaq\_free(3)](/lowdown_metaq_free/3.md), [lowdown\_roff\_free(3)](/lowdown_roff_free/3.md), [lowdown\_roff\_new(3)](/lowdown_roff_new/3.md), [lowdown\_roff\_rndr(3)](/lowdown_roff_rndr/3.md), [lowdown\_odt\_free(3)](/lowdown_odt_free/3.md), [lowdown\_odt\_new(3)](/lowdown_odt_new/3.md), [lowdown\_odt\_rndr(3)](/lowdown_odt_rndr/3.md), [lowdown\_term\_free(3)](/lowdown_term_free/3.md), [lowdown\_term\_new(3)](/lowdown_term_new/3.md), [lowdown\_term\_rndr(3)](/lowdown_term_rndr/3.md), [lowdown\_tree\_rndr(3)](/lowdown_tree_rndr/3.md), [lowdown(5)](/lowdown/5.md)

## AUTHORS

**lowdown** was forked from *hoedown:* **https://github.com/hoedown/hoedown** by Kristaps Dzonsons, *kristaps@bsd.lv*. It has been considerably modified since.
