func to_html_with_heading_offset(consume markdown: String, extensions: &[Extension], heading_offset: Int) -> StringParses Markdown and renders escaped HTML with shifted heading levels.
The offset is added to each heading; values above six clamp to h6, while callers must keep the resulting level positive. Raw Markdown HTML is not passed through as trusted markup; text, destinations, titles, and code are escaped.
View Source
pub func to_html_with_heading_offset(consume markdown: String, extensions: &[Extension], heading_offset: Int) -> String {
let output = StringBuilder()
let document = parse(markdown: markdown, extensions: extensions)
for block in document.blocks {
output.append(string: block.to_string_with_heading_offset(heading_offset: heading_offset))
}
output.finish()
}