Skip to content

Add support for language-specific formatting #28

Description

@terror

If a language tag is present, we currently won't end up doing 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions