diff options
| author | bors <bors@rust-lang.org> | 2022-12-11 09:01:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-11 09:01:37 +0000 |
| commit | f34356eaceeb5540f4e2e20abc1d824daf395806 (patch) | |
| tree | 943d4c0b629b383abb9eb37494290f199fcfabfc /src/librustdoc/html/markdown | |
| parent | b3ddfeb5a88352aa6d157f722976937da7b97307 (diff) | |
| parent | 49027dbc02392f22f204577b2cfa9a4aba35e76e (diff) | |
Auto merge of #105554 - matthiaskrgr:rollup-ir60gc7, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #105411 (Introduce `with_forced_trimmed_paths`) - #105532 (Document behaviour of `--remap-path-prefix` with several matches) - #105537 (compiler: remove unnecessary imports and qualified paths) - #105539 (rustdoc: Only hide lines starting with `#` in rust code blocks ) - #105546 (Add some regression tests for #44454) - #105547 (Add regression test for #104582) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html/markdown')
| -rw-r--r-- | src/librustdoc/html/markdown/tests.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/librustdoc/html/markdown/tests.rs b/src/librustdoc/html/markdown/tests.rs index e4f72a05789..68b31a6ee08 100644 --- a/src/librustdoc/html/markdown/tests.rs +++ b/src/librustdoc/html/markdown/tests.rs @@ -309,3 +309,40 @@ fn test_find_testable_code_line() { 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>", + ); +} |
