Skip to main content

highlight_code

Function highlight_code 

Source
pub fn highlight_code(code: &str, language: Option<&str>) -> String
Expand description

Apply syntax highlighting to code.

Returns HTML string with inline styles for syntax highlighting. Falls back to plain code wrapped in <code> if highlighting fails.