Strip last backline from non-rust code examples

This commit is contained in:
Guillaume Gomez 2024-09-21 15:58:18 +02:00
parent da889684c8
commit 7c35266552
2 changed files with 5 additions and 5 deletions

View File

@ -261,7 +261,9 @@ fn next(&mut self) -> Option<Self::Item> {
</pre>\
</div>",
added_classes = added_classes.join(" "),
text = Escape(&original_text),
text = Escape(
original_text.strip_suffix('\n').unwrap_or(&original_text)
),
)
.into(),
));

View File

@ -524,15 +524,13 @@ fn t(input: &str, expect: &str) {
####.###..#....#....#..#.
#..#.#....#....#....#..#.
#..#.#....#....#....#..#.
#..#.####.####.####..##..
</code></pre></div>",
#..#.####.####.####..##..</code></pre></div>",
);
t(
r#"```markdown
# hello
```"#,
"<div class=\"example-wrap\"><pre class=\"language-markdown\"><code>\
# hello
</code></pre></div>",
# hello</code></pre></div>",
);
}