Skip to content

Features and Flags

Standards coverage

  • Full CommonMark conformance: 652/652 spec tests pass with RenderPolicy::Trusted. The secure default escapes raw HTML by design and passes 577/652.
  • All five GFM extensions:
    • Tables
    • Strikethrough
    • Task lists
    • Autolink literals
    • Disallowed raw HTML

Beyond GFM

  • Optional horizontal table-cell spans (||, |||)
  • Optional relative table-column width hints
  • Reference and inline footnotes
  • Front matter extraction (--- and +++)
  • Heading IDs (GitHub-compatible slugs)
  • Math spans ($ and $$)
  • Callouts (> [!NOTE], > [!WARNING], etc.)
  • Highlight (==text== renders <mark>)
  • Superscript (^text^ renders <sup>)
  • Subscript (~text~ renders <sub>)
  • Definition lists (Term followed by : Definition)

Configuration flags

Enable only what your workload needs:

allow_html · allow_link_refs · tables · merged_table_cells · table_column_widths · strikethrough · highlight
superscript · subscript · task_lists · autolink_literals
disallowed_raw_html · footnotes · inline_footnotes · front_matter · heading_ids
math · callouts · definition_lists · line_comments · indented_code_blocks

Merged table cells

Enable merged_table_cells together with tables for MultiMarkdown/iA-style horizontal spans. The number of adjacent pipes after a cell is its colspan:

| Name | Price | Tax |
| --- | ---: | ---: |
| Gift | 0$ ||

Here 0$ spans two columns. Whitespace between pipes keeps an explicit empty cell. When the flag is disabled, consecutive pipes use normal GFM empty-cell semantics.

Enable table_column_widths to interpret the relative number of dashes in each delimiter cell as a numeric HTML <col> width hint:

| Short | Long |
| -- | ------ |

This produces 25% and 75% hints. Alignment colons do not contribute to the ratio. The option composes with merged_table_cells: widths still describe the underlying table columns, while a merged cell spans those columns.

Inline footnotes

Enable inline_footnotes for Pandoc-style notes:

The result needs context.^[This note can contain *inline Markdown*.]

This flag is independent from reference footnotes. Inline and reference notes share first-appearance numbering in HTML. The iA Presenter [^Footnote text.] form remains reference syntax to avoid ambiguity.

Event-based presentation adapters can use InlineEvent::InlineFootnote to collect notes and place them at slide boundaries.

Definition lists

Definition lists are an independent opt-in extension:

use ferromark::Options;

let options = Options {
    definition_lists: true,
    ..Options::commonmark()
};
let html = ferromark::to_html_with_options(markdown, &options);

Start from Options::minimal(), Options::commonmark(), or Options::gfm() and override only the syntax flags your documents use. These are dialect constructors, not performance profiles.

Rendering policy

RenderPolicy::Untrusted is the default. It escapes raw HTML and rejects unsafe URL schemes after entity and control-character normalization. Use RenderPolicy::Trusted only for content you control. The disallowed_raw_html option is the narrower GFM tag filter, not a general HTML sanitizer.

See the 0.2 migration guide for the related API changes.

Design trade-offs

ferromark optimizes for streaming Markdown-to-HTML throughput:

  • No AST access
  • No source map offsets
  • HTML output only

If you need AST traversal or alternate output formats, choose a parser built for that model.