Fix quote text alignment

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/17/head
trivernis 3 years ago
parent d5df0b6f05
commit e50d73a880
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -665,6 +665,15 @@ impl Quote {
pub fn add_text(&mut self, text: TextLine) {
self.text.push(text)
}
/// Strips a single linebreak from the end of the quote
pub fn strip_linebreak(&mut self) {
if let Some(last) = self.text.last_mut() {
if let Some(Inline::LineBreak) = last.subtext.last() {
last.subtext.pop();
}
}
}
}
impl ImportAnchor {

@ -99,6 +99,8 @@ table tr td:first-child, table tr th:first-child {
blockquote {
margin-left: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
background-color: rgba(0, 0, 0, 0);
}

@ -191,6 +191,8 @@ impl ParseBlock for Parser {
break;
}
}
quote.strip_linebreak();
if quote.text.len() == 0 {
return Err(self.ctm.rewind_with_error(start_index).into());
}

Loading…
Cancel
Save