mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add test for non-rust code block hashtag prepended lines
This commit is contained in:
committed by
Mark Rousskov
parent
4b988c9f11
commit
d4bafb6aa5
@@ -309,3 +309,40 @@ fn add_test(&mut self, _test: String, _config: LangString, line: usize) {
|
||||
t("```rust\n```\n```rust\n```", &[1, 3]);
|
||||
t("```rust\n```\n ```rust\n```", &[1, 3]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ascii_with_prepending_hashtag() {
|
||||
fn t(input: &str, expect: &str) {
|
||||
let mut map = IdMap::new();
|
||||
let output = Markdown {
|
||||
content: input,
|
||||
links: &[],
|
||||
ids: &mut map,
|
||||
error_codes: ErrorCodes::Yes,
|
||||
edition: DEFAULT_EDITION,
|
||||
playground: &None,
|
||||
heading_offset: HeadingOffset::H2,
|
||||
}
|
||||
.into_string();
|
||||
assert_eq!(output, expect, "original: {}", input);
|
||||
}
|
||||
|
||||
t(
|
||||
r#"```ascii
|
||||
#..#.####.#....#.....##..
|
||||
#..#.#....#....#....#..#.
|
||||
####.###..#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.####.####.####..##..
|
||||
```"#,
|
||||
"<div class=\"example-wrap\"><pre class=\"language-ascii\"><code>\
|
||||
#..#.####.#....#.....##..
|
||||
#..#.#....#....#....#..#.
|
||||
####.###..#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.#....#....#....#..#.
|
||||
#..#.####.####.####..##..
|
||||
</code></pre></div>",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user