Skip to content
ironmark

Options

Every function takes the same options object. JavaScript uses camelCase keys; Rust uses the snake_case fields of ParseOptions.

import { markdownToHtml } from "ironmark";
 
markdownToHtml(input, { hardBreaks: false, enableTables: false });
use ironmark::{render_html, ParseOptions};
 
render_html(input, &ParseOptions { hard_breaks: false, enable_tables: false, ..Default::default() });

Extensions

All extensions default to true, except front matter.

OptionJS (camelCase)Rust (snake_case)Description
Hard breakshardBreakshard_breaksEvery newline becomes <br />
HighlightenableHighlightenable_highlight==text== becomes <mark>
StrikethroughenableStrikethroughenable_strikethrough~~text~~ becomes <del>
UnderlineenableUnderlineenable_underline++text++ becomes <u>
TablesenableTablesenable_tablesPipe table syntax
AutolinkenableAutolinkenable_autolinkBare URLs and emails become <a>
Task listsenableTaskListsenable_task_lists- [ ] / - [x] checkboxes
Indented codeenableIndentedCodeBlocksenable_indented_code_blocks4-space indent becomes <pre><code>
Wiki linksenableWikiLinksenable_wiki_links[[page]] becomes <a href="page">
LaTeX mathenableLatexMathenable_latex_math$inline$ and $$display$$ become <span class="math-…">
Front matterenableFrontmatterenable_frontmatterSkip a leading ---/+++ block (off by default)
Heading IDsenableHeadingIdsenable_heading_idsAuto id= on headings from slugified text
Heading anchorsenableHeadingAnchorsenable_heading_anchors<a class="anchor"> inside each heading (implies IDs)
Permissive headingspermissiveAtxHeaderspermissive_atx_headersAllow #Heading without a space after #

MDX

enableMdx / enable_mdx (default false) parses JSX tags, expressions in braces and import/export. See MDX.

Security

safe, disableRawHtml, noHtmlBlocks, noHtmlSpans, tagFilter and the size limits are covered in Security.

Other options

OptionJS (camelCase)Rust (snake_case)DefaultDescription
Collapse whitespacecollapseWhitespacecollapse_whitespacefalseCollapse runs of spaces and tabs in text to one space
Presetpreset——Apply a named preset (JS only)
Deterministicdeterministic—falseNormalize whitespace for stable output (JS only)

DEFAULT_OPTIONS holds the effective default of every option; see Constants.

CommonMark baseline

The CommonMark spec tests run with hardBreaks: false and enableAutolink: false. For plain CommonMark behaviour, use the strict preset.