wip
This commit is contained in:
parent
60927e7298
commit
5afc6a41a8
1 changed files with 20 additions and 2 deletions
22
src/block.rs
22
src/block.rs
|
@ -163,8 +163,11 @@ impl<'s> Parser<'s> {
|
|||
|
||||
// trim ending whitespace of block if not verbatim
|
||||
if !matches!(l, Leaf::CodeBlock { .. }) {
|
||||
let last = &mut lines[line_count - 1];
|
||||
*last = last.trim_end(self.src);
|
||||
let l = lines.len();
|
||||
if l > 0 {
|
||||
let last = &mut lines[l - 1];
|
||||
*last = last.trim_end(self.src);
|
||||
}
|
||||
}
|
||||
|
||||
lines
|
||||
|
@ -728,6 +731,21 @@ mod test {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_thematic_break() {
|
||||
test_block!("---\n", Block::Leaf(ThematicBreak), "---", 1);
|
||||
test_block!(
|
||||
concat!(
|
||||
" -*- -*-\n",
|
||||
"\n", //
|
||||
"para", //
|
||||
),
|
||||
Block::Leaf(ThematicBreak),
|
||||
"-*- -*-",
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_code_block() {
|
||||
test_block!(
|
||||
|
|
Loading…
Reference in a new issue