Skip to main content

render_markdown

Function render_markdown 

Source
pub fn render_markdown(
    content: &str,
    highlighter: &Highlighter,
    base_path: &str,
    page_url: &str,
) -> Result<String>
Expand description

Render markdown content to HTML with syntax-highlighted code blocks. Internal links (starting with /) are prefixed with base_path.

page_url is the current page’s canonical URL path (base-prefixed, with a trailing slash — e.g. /webui/guide/). In-page fragment links (heading anchors and [text](#section) links) are emitted as absolute paths ({page_url}#slug) rather than bare #slug. A bare fragment would resolve against the document’s <base href> — which points at the site root — and navigate away from the current page instead of scrolling within it.