pub struct Constructs {Show 34 fields
pub html_block: bool,
pub html_inline: bool,
pub html_container: bool,
pub indented_code: bool,
pub gfm_table: bool,
pub gfm_task_list_item: bool,
pub gfm_strikethrough: bool,
pub gfm_autolink_literal: bool,
pub relaxed_autolinks: bool,
pub gfm_alert: bool,
pub underline: bool,
pub insert: bool,
pub highlight: bool,
pub subscript: bool,
pub superscript: bool,
pub spoiler: bool,
pub shortcode: bool,
pub description_list: bool,
pub footnote_definition: bool,
pub footnote_reference: bool,
pub inline_footnote: bool,
pub math_block: bool,
pub math_inline: bool,
pub frontmatter: bool,
pub wikilink_title_after_pipe: bool,
pub wikilink_title_before_pipe: bool,
pub mdx_esm: bool,
pub mdx_expression_block: bool,
pub mdx_expression_inline: bool,
pub mdx_jsx_block: bool,
pub mdx_jsx_inline: bool,
pub directive_text: bool,
pub directive_leaf: bool,
pub directive_container: bool,
}Expand description
The full set of syntactic constructs the parser may recognize, one boolean
per feature. This is the exhaustive escape hatch; most callers use the
Constructs::commonmark/gfm/mdx/
max presets or the Construct builder instead of
setting fields directly.
Fields§
§html_block: boolRaw HTML blocks, e.g. a <div>…</div> block at the top level.
html_inline: boolRaw inline HTML, e.g. <span> within a paragraph.
html_container: boolStructured Markdown-compatible HTML containers such as <details>.
indented_code: boolIndented code blocks (each line indented four spaces or a tab).
gfm_table: boolGFM pipe tables: a | a | b | row over a |---|---| delimiter row.
gfm_task_list_item: boolGFM task list items: - [ ] (unchecked) and - [x] (checked).
gfm_strikethrough: boolGFM strikethrough: ~~text~~.
gfm_autolink_literal: boolGFM literal autolinks: a bare https://…, www.…, or email becomes a
link without angle brackets.
relaxed_autolinks: boolcmark-gfm “relaxed” URL autolinks: bare scheme:// URLs (and a bare
leading ://) are auto-linkified without angle brackets, e.g. smb://,
irc://, rdar://. This is a cmark extension beyond the GFM spec (which
defines only http(s):///www./email); on by default in gfm() for
GitHub/cmark-gfm parity. The angle form <scheme:…> works regardless.
gfm_alert: boolGFM alerts: a > [!NOTE] (TIP/IMPORTANT/WARNING/CAUTION) blockquote.
underline: boolUnderline spans: __text__. This overrides CommonMark’s __-as-strong,
so it is off in the max default.
insert: boolCriticMarkup-style insertions: ++text++.
highlight: boolHighlight / “mark” spans: ==text==.
subscript: boolSubscript: a single-tilde span ~text~ (no spaces).
superscript: boolSuperscript: ^text^.
spoiler: boolSpoiler spans: ||text||.
shortcode: boolEmoji-style shortcodes: :tada:.
description_list: boolDescription (definition) lists: a term followed by :-led details.
footnote_definition: boolFootnote definitions: [^1]: the footnote body.
footnote_reference: boolFootnote references: [^1] in running text.
inline_footnote: boolInline footnotes: ^[the note inline] (also needs footnote_reference).
math_block: boolBlock math: a $$ … $$ fenced block.
math_inline: boolInline math: $x$ (and the math-code form $`x`$).
frontmatter: boolA leading frontmatter block at the start of the document: --- YAML or
+++ TOML.
wikilink_title_after_pipe: boolWikilinks with the display title after the pipe: [[target|title]]
(the Obsidian convention). Mutually exclusive with the before-pipe order.
wikilink_title_before_pipe: boolWikilinks with the display title before the pipe: [[title|target]].
Mutually exclusive with the after-pipe order.
mdx_esm: boolMDX ESM: import/export statement lines.
mdx_expression_block: boolMDX block-level { … } expressions.
mdx_expression_inline: boolMDX inline { … } expressions within text.
mdx_jsx_block: boolMDX block-level JSX: <Component/> as a block. Conflicts with raw HTML.
mdx_jsx_inline: boolMDX inline JSX: <Component/> within text. Conflicts with raw HTML.
directive_text: boolInline directive: :name[label]{key=val}. A directive, not MDX.
directive_leaf: boolLeaf directive: ::name[label]{key=val} on its own line. A directive,
not MDX.
directive_container: boolContainer directive: a :::name … ::: fenced block. A directive, not MDX.
Implementations§
Source§impl Constructs
impl Constructs
Sourcepub const fn commonmark() -> Self
pub const fn commonmark() -> Self
The CommonMark baseline: raw HTML and indented code, no extensions.
Sourcepub const fn gfm() -> Self
pub const fn gfm() -> Self
GitHub Flavored Markdown: CommonMark plus tables, task lists, strikethrough, literal autolinks, and footnotes.
Sourcepub const fn mdx() -> Self
pub const fn mdx() -> Self
MDX: CommonMark with raw HTML and indented code off, and MDX ESM, expressions, and JSX on.
Sourcepub const fn max() -> Self
pub const fn max() -> Self
The maximal non-MDX construct set, and the default dialect: every
construct that does not reinterpret a core CommonMark delimiter. MDX is
off (it conflicts with raw HTML and reinterprets {…}/<…>), and
underline is off because it would parse __bold__ as underline,
overriding CommonMark strong. The wikilink title order is after-pipe.