Testing rustfmts support for formatting code blocks in markdown files

The goal here is to format rust code blocks in markdown files.
Formatting will mostly impact unformatted code blocks, however there will be minor changes to markdown constructs outside of code blocks. For example, aligning GitHub Flavored Markdown (GFM) tables.

fn main()   {
                println!(            "Hello world!"
                )
}

Here‘s an indented code block that won’t be formatted

fn main()   {
                println!(            "Hello world!"
                )
}

Here's a code block in a blockquote

fn main()   {
                  println!(            "Hello world!"
                  )
}
  • Here's a code block in a list!
    fn main()   {
                    println!(            "Hello world!"
                    )
    }
    
  • Here's a code block in a deeply nested markdown context
  • fn main()   {
                  println!(            "Hello world!"
                   )
    }
    

Oh and we've got some cool support for aligning tables:

column 1column 2column 3
values for column 1values for column 2values for column 3
😁😁🎉🎉🎉😁 :^) :^)

Check out the commonmark spec!

Look we can also link to rust traits or types like Debug and [Vec]. Some additional text with [brackets]. what if I manually [esacpe the bracket]? looks like they stay escaped!