fixup! 21784e2a57450d4ca120f62c317331c6feb1cbbd
This commit is contained in:
parent
e080b16bf7
commit
6a0c1ca3f8
1 changed files with 4 additions and 4 deletions
|
@ -98,16 +98,16 @@ impl<'s> Parser<'s> {
|
||||||
first.end() - first.of(self.src).trim_start().len(),
|
first.end() - first.of(self.src).trim_start().len(),
|
||||||
first.end(),
|
first.end(),
|
||||||
);
|
);
|
||||||
let len = match l {
|
let line_count = match l {
|
||||||
CodeBlock { .. } => line_count - 2,
|
CodeBlock { .. } => line_count - 1,
|
||||||
_ => line_count,
|
_ => line_count,
|
||||||
};
|
};
|
||||||
if !matches!(l, Leaf::CodeBlock { .. }) {
|
if !matches!(l, Leaf::CodeBlock { .. }) {
|
||||||
// trim ending whitespace of block
|
// trim ending whitespace of block
|
||||||
let last = &mut lines[len - 1];
|
let last = &mut lines[line_count - 1];
|
||||||
*last = last.with_len(last.of(self.src).trim_end().len());
|
*last = last.with_len(last.of(self.src).trim_end().len());
|
||||||
}
|
}
|
||||||
for line in &lines[0..len] {
|
for line in &lines[0..line_count] {
|
||||||
self.tree.elem(Atom::Inline, *line);
|
self.tree.elem(Atom::Inline, *line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue