html: fix initial newline when hr first element
This commit is contained in:
parent
9bbfb5ed75
commit
d2a46663f1
1 changed files with 4 additions and 1 deletions
|
@ -392,7 +392,10 @@ impl<'s> Writer<'s> {
|
|||
Event::Softbreak => out.write_char('\n')?,
|
||||
Event::Escape | Event::Blankline => {}
|
||||
Event::ThematicBreak(attrs) => {
|
||||
out.write_str("\n<hr")?;
|
||||
if self.not_first_line {
|
||||
out.write_char('\n')?;
|
||||
}
|
||||
out.write_str("<hr")?;
|
||||
for (a, v) in attrs.iter() {
|
||||
write!(out, r#" {}=""#, a)?;
|
||||
v.parts().try_for_each(|part| write_attr(part, &mut out))?;
|
||||
|
|
Loading…
Reference in a new issue