Markdown
Pro
Markdown is for editors who'd rather write **bold** and ## Heading than click toolbar buttons. The field stores the Markdown as written, and converts it to HTML when it's displayed.
Settings
- Default editor mode: open the editor in writing mode, side by side with a preview, or preview only.
- Toolbar: a minimal, standard or full set of formatting buttons.
- Tables, Task lists, Strikethrough and Autolink turn those Markdown extensions on or off. All are on by default.
- Allow HTML lets writers mix raw HTML into the Markdown. It's off by default; only turn it on for trusted authors, because raw HTML can change the page layout.
- Min length and Max length, and the editor's height in rows.
Displaying it
Dynamic tags and the REST API give you both the original Markdown and the converted, sanitized HTML. In most places you want the HTML.
Technical details for LLMs
- Type key:
markdown(Pro). Settings:preview_mode(edit|split|preview),toolbar(minimal|standard|full),enable_tables,enable_task_lists,enable_strikethrough,enable_autolink(default true),allow_html(default false),min_rows(8),max_rows(40),minlength,maxlength,placeholder,default_value. - Stored: the raw Markdown string. REST read:
{ content, formatted }(formatted= sanitized HTML); write: the Markdown string only. - PHP:
\VxFramework\render_markdown(). It is defined on every site, including one without the Markdown field, where it prints the text escaped, as paragraphs, so a theme can call it unguarded. Filters:vxframework/fieldsets/markdown/pre_render,post_render,converter_config.