diff --git a/src/markdown.rs b/src/markdown.rs
index 8a14d85..d326fe7 100644
--- a/src/markdown.rs
+++ b/src/markdown.rs
@@ -152,6 +152,10 @@ fn render_markdown<'md>(src: &'md str, mut p: ParserVars<'md>) -> std::io::Resul
}
Image { dest_url, .. } => {
+ p.html.write_fmt(format_args!(
+ "
",
+ dest_url
+ ))?;
p.links.push(GmiLink::from_url(dest_url));
p.state = State::Link;
}
@@ -240,12 +244,13 @@ fn render_markdown<'md>(src: &'md str, mut p: ParserVars<'md>) -> std::io::Resul
p.html.write_all(b"")?;
write_inline(&mut p, "~")?;
}
- Link | Image => {
- p.gmi.write_fmt(format_args!(
- "{}[{}]", // example[1] ...\r\n => https://... [1]: example
- p.links.last().unwrap().title,
- p.links.len(),
- ))?;
+ Link => {
+ p.html.write_all(b"")?;
+ p.gmi.write_fmt(format_args!("[{}]", p.links.len()))?;
+ }
+ Image => {
+ p.html.write_all(b"")?;
+ p.gmi.write_fmt(format_args!("[{}]", p.links.len()))?;
}
TableHead => p.html.write_all(b"
")?,
TableRow => p.html.write_all(b"")?,
@@ -368,10 +373,9 @@ fn write_inline(p: &mut ParserVars, text: &str) -> std::io::Result<()> {
State::Footnote => {
p.notes.last_mut().unwrap().content.push_str(text);
}
- _ => {
- p.gmi.write_all(text.as_bytes())?;
- }
+ _ => {}
}
+ p.gmi.write_all(text.as_bytes())?;
Ok(())
}