present icon indicating copy to clipboard operation
present copied to clipboard

Add support for language-specific formatting

Open terror opened this issue 1 year ago • 0 comments

If a language tag is present, we currently won't end up going anything, i.e this test will fail:

#[test]
fn language_specific_formatting() -> Result {
  Test::new()?
    .markdown(
      r#"
      ```rust present echo "fn main() { println!(\"Hello, World!\"); }"
      ```
      "#,
    )
    .expected_status(0)
    .expected_stdout(
      r#"
      ```rust present echo "fn main() { println!(\"Hello, World!\"); }"
      fn main() { println!("Hello, World!"); }
      ```
      "#,
    )
    .run()
}

We can make it pass by looking for a subset of keywords as language tags, and then doing the entire parse -> command interpolation flow.

terror avatar Oct 04 '24 03:10 terror