html: fix invalid html for footnote inside image

This commit is contained in:
Noah Hellman 2023-03-12 17:04:17 +01:00
parent c6022004bb
commit 33d8215a2a

View file

@ -402,11 +402,13 @@ impl<'s, I: Iterator<Item = Event<'s>>, W: std::fmt::Write> Writer<'s, I, W> {
Raw::Other => {} Raw::Other => {}
}, },
Event::FootnoteReference(_tag, number) => { Event::FootnoteReference(_tag, number) => {
write!( if self.img_alt_text == 0 {
self.out, write!(
r##"<a id="fnref{}" href="#fn{}" role="doc-noteref"><sup>{}</sup></a>"##, self.out,
number, number, number r##"<a id="fnref{}" href="#fn{}" role="doc-noteref"><sup>{}</sup></a>"##,
)?; number, number, number
)?;
}
} }
Event::Symbol(sym) => write!(self.out, ":{}:", sym)?, Event::Symbol(sym) => write!(self.out, ":{}:", sym)?,
Event::LeftSingleQuote => self.out.write_str("&lsquo;")?, Event::LeftSingleQuote => self.out.write_str("&lsquo;")?,