markdown

Markdown-to-HTML renderer for the web layer using pulldown-cmark.

fn render_markdown_to_html

source

pub fn render_markdown_to_html(text: &str) -> String

Convert a markdown string to HTML suitable for template rendering.

Tables, strikethrough and task lists are on. Raw HTML in the input passes through as pulldown-cmark writes it. The page middleware does not write the nonce or the CSRF token into user text, because the placeholders it replaces are random in each process; see crate::web::nonce::nonce_placeholder. Raw HTML is not sanitized, so a script that the Content-Security-Policy allows can still run; task lxpqmxto tracks that.

Parameter Type Description
text &str the Markdown source
returns String The rendered HTML fragment.