Skip to main content

apply_syntax_highlighting

Function apply_syntax_highlighting 

Source
pub fn apply_syntax_highlighting(
    code: &str,
    lang: &str,
) -> Result<String, MarkdownError>
Expand description

Highlights a code string with class-based spans (standalone API).

This is the public entry point for callers who want to highlight code outside of the markdown pipeline. Output is a sequence of <span class="…"> tags — pair it with theme_css to produce a stylesheet that renders the colours.