- Description:
This key defines configuration options for the Markdown processing engine.
The value is an object that can contain various options controlling how Markdown is converted to HTML and vice versa.
- Appears in:
- Type:
Object- Properties:
This key defines positioning behavior of Markdown attributes for different element types when converting HTML to Markdown.
The value is an object that can contain
inline,block, or element-specific properties. Each property value specifies where attribute lists should be positioned for that element type. Valid values arenone,right,space right,below,newline below, orright-of-prefix.This key only takes effect when
attributesis enabled.Show examplesHide examples
In this example, we have configured attribute positioning for inline and block elements.
Copied to clipboardmarkdown: engine: commonmark options: attributes: true attribute_elements: inline: right block: below{ "markdown": { "engine": "commonmark", "options": { "attributes": true, "attribute_elements": { "inline": "right", "block": "below" } } } }This key toggles whether CloudCannon will save element attributes in Markdown format instead of converting them to HTML when converting HTML to Markdown.
Setting this key to
truewill preserve element attributes in Markdown format (using attribute lists) rather than converting them to HTML.By default, this key is
false(i.e., element attributes are converted to HTML).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to save element attributes in Markdown format.
Copied to clipboardmarkdown: engine: commonmark options: attributes: true{ "markdown": { "engine": "commonmark", "options": { "attributes": true } } }This key toggles whether CloudCannon will convert line breaks (
\n) in paragraphs into<br>tags when converting Markdown to HTML.Setting this key to
truewill convert line breaks within paragraphs into<br>tags.By default, this key is
false(i.e., line breaks in paragraphs are not converted to<br>tags).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to convert line breaks in paragraphs into
<br>tags.Copied to clipboardmarkdown: engine: commonmark options: breaks: true{ "markdown": { "engine": "commonmark", "options": { "breaks": true } } }This key defines which style of code block fences CloudCannon will use when converting HTML to Markdown.
The value can be
\``(three backticks) or~~~` (three tildes).Allowed values:
```~~~Show examplesHide examples
In this example, we have configured Markdown to use tildes for code block fences.
Copied to clipboardmarkdown: engine: commonmark options: code_block_fences: ~~~{ "markdown": { "engine": "commonmark", "options": { "code_block_fences": "~~~" } } }This key toggles whether CloudCannon will render snippets as plain text within code blocks when processing Markdown.
Setting this key to
truewill prevent snippets from being processed within code blocks, rendering them as plain text instead.By default, this key is
false(i.e., snippets within code blocks may be processed).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to render snippets as plain text within code blocks.
Copied to clipboardmarkdown: engine: commonmark options: escape_snippets_in_code_blocks: true{ "markdown": { "engine": "commonmark", "options": { "escape_snippets_in_code_blocks": true } } }This key toggles whether CloudCannon will enable GitHub Flavored Markdown (GFM) mode when processing Markdown.
Setting this key to
truewill enable GFM mode, which includes features like tables, strikethrough, task lists, and autolinks.By default, this key is
false(i.e., GFM mode is disabled).Show examplesHide examples
In this example, we have configured Markdown to enable GitHub Flavored Markdown mode.
Copied to clipboardmarkdown: engine: commonmark options: gfm: true{ "markdown": { "engine": "commonmark", "options": { "gfm": true } } }This key toggles whether CloudCannon will generate IDs for headings when converting Markdown to HTML.
Setting this key to
truewill automatically generate ID attributes for heading elements based on their text content.By default, this key is
false(i.e., IDs are not generated for headings).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to generate IDs for headings.
Copied to clipboardmarkdown: engine: commonmark options: heading_ids: true{ "markdown": { "engine": "commonmark", "options": { "heading_ids": true } } }This key toggles whether CloudCannon will output HTML tags from source when converting Markdown to HTML.
Setting this key to
truewill allow HTML tags in the Markdown source to be output in the resulting HTML.By default, this key is
false(i.e., HTML tags in Markdown source are not output).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output HTML tags from source.
Copied to clipboardmarkdown: engine: commonmark options: html: true{ "markdown": { "engine": "commonmark", "options": { "html": true } } }This key toggles whether CloudCannon will automatically convert URL-like text to links when converting Markdown to HTML.
Setting this key to
truewill automatically convert text that looks like URLs into clickable links.By default, this key is
false(i.e., URL-like text is not automatically converted to links).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to automatically convert URL-like text to links.
Copied to clipboardmarkdown: engine: commonmark options: linkify: true{ "markdown": { "engine": "commonmark", "options": { "linkify": true } } }This key defines double and single quotes replacement pairs for quote beautification when
typographeris enabled.The value is a string that specifies quote pairs. For example, you can use
"«»„""for Russian,""„"‚""for German, and["«\xA0", "\xA0»", "‹\xA0", "\xA0›"]for French (includingnbsp).This key only takes effect when
typographeris enabled.Show examplesHide examples
In this example, we have configured quote replacement pairs for Russian typography.
Copied to clipboardmarkdown: engine: commonmark options: typographer: true quotes: «»„""{ "markdown": { "engine": "commonmark", "options": { "typographer": true, "quotes": "«»„\"\"" } } }This key toggles whether CloudCannon will add line breaks between sentences when converting HTML to Markdown.
Setting this key to
truewill add line breaks between sentences in the output Markdown.By default, this key is
false(i.e., line breaks are not added between sentences).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to add line breaks between sentences.
Copied to clipboardmarkdown: engine: commonmark options: sentence_per_line: true{ "markdown": { "engine": "commonmark", "options": { "sentence_per_line": true } } }This key toggles whether CloudCannon will output lists with an extra space when converting HTML to Markdown.
Setting this key to
truewill add an extra space in list items when outputting Markdown.By default, this key is
false(i.e., lists are output without an extra space).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output lists with an extra space.
Copied to clipboardmarkdown: engine: commonmark options: spaced_lists: true{ "markdown": { "engine": "commonmark", "options": { "spaced_lists": true } } }This key toggles whether CloudCannon will output strikethrough text wrapped in double tildes when converting HTML to Markdown.
Setting this key to
truewill output strikethrough text as~~strike~~in Markdown.By default, this key is
false(i.e., strikethrough text is not output in double tildes format).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output strikethrough text wrapped in double tildes.
Copied to clipboardmarkdown: engine: commonmark options: strikethrough: true{ "markdown": { "engine": "commonmark", "options": { "strikethrough": true } } }This key toggles whether CloudCannon will output subscript text wrapped in tildes when converting HTML to Markdown.
Setting this key to
truewill output subscript text as~sub~in Markdown.By default, this key is
false(i.e., subscript text is not output in tildes format).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output subscript text wrapped in tildes.
Copied to clipboardmarkdown: engine: commonmark options: subscript: true{ "markdown": { "engine": "commonmark", "options": { "subscript": true } } }This key toggles whether CloudCannon will output superscript text wrapped in carets when converting HTML to Markdown.
Setting this key to
truewill output superscript text as^super^in Markdown.By default, this key is
false(i.e., superscript text is not output in carets format).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output superscript text wrapped in carets.
Copied to clipboardmarkdown: engine: commonmark options: superscript: true{ "markdown": { "engine": "commonmark", "options": { "superscript": true } } }This key toggles whether CloudCannon will output tables in Markdown format when converting HTML to Markdown.
Setting this key to
truewill convert HTML tables to Markdown table format.By default, this key is
false(i.e., tables are not output in Markdown format).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to output tables in Markdown format.
Copied to clipboardmarkdown: engine: commonmark options: table: true{ "markdown": { "engine": "commonmark", "options": { "table": true } } }This key toggles whether CloudCannon will treat 4 spaces of indentation as a code block when processing Markdown.
Setting this key to
truewill read indented blocks (4 spaces) as code blocks.By default, this key is
false(i.e., indented blocks are not treated as code blocks).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to treat 4 spaces of indentation as code blocks.
Copied to clipboardmarkdown: engine: commonmark options: treat_indentation_as_code: true{ "markdown": { "engine": "commonmark", "options": { "treat_indentation_as_code": true } } }This key toggles whether CloudCannon will enable typographic replacements and quote beautification when converting Markdown to HTML.
Setting this key to
truewill enable language-neutral replacements (such as dashes and ellipses) and beautify quotes based on thequotesconfiguration.By default, this key is
false(i.e., typographic replacements and quote beautification are disabled).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to enable typographic replacements and quote beautification.
Copied to clipboardmarkdown: engine: commonmark options: typographer: true quotes: «»„""{ "markdown": { "engine": "commonmark", "options": { "typographer": true, "quotes": "«»„\"\"" } } }This key toggles whether CloudCannon will use XHTML-style closing for single tags when converting Markdown to HTML.
Setting this key to
truewill use/to close single tags (e.g.,<br />instead of<br>).By default, this key is
false(i.e., single tags are not closed with/).Defaults to:
falseShow examplesHide examples
In this example, we have configured Markdown to use XHTML-style closing for single tags.
Copied to clipboardmarkdown: engine: commonmark options: xhtml: true{ "markdown": { "engine": "commonmark", "options": { "xhtml": true } } }- Examples:
In this example, we have configured Markdown options to enable HTML output, convert line breaks, and enable GitHub Flavored Markdown.
Copied to clipboardmarkdown: engine: commonmark options: html: true breaks: true gfm: true{ "markdown": { "engine": "commonmark", "options": { "html": true, "breaks": true, "gfm": true } } }