Skip to main content

format

Function format 

Source
pub fn format(input: &str) -> String
Expand description

Format a Markdown document to canonical style.

Returns the formatted document as a String. The output:

  • Always ends with exactly one trailing newline (or is empty for empty input)
  • Has exactly one blank line between top-level block elements
  • Uses ATX-style headings
  • Uses - for unordered list markers
  • Uses backtick fences for code blocks