Skip to main content

render_markdown

Function render_markdown 

Source
pub fn render_markdown(input: &str) -> Markup
Expand description

Render untrusted CommonMark and GitHub-flavored Markdown into safe Markup.

Enables tables, strikethrough, task lists, and heading attributes. Drops raw HTML blocks and inline HTML tags so untrusted authors cannot inject <script>, on* event handlers, or HTMX/Alpine attributes (hx-*, x-data, x-init). Rewrites unsafe link or image URL schemes (javascript:, vbscript:, data:) to "#".