table wrapping

This commit is contained in:
Alphonse Paix
2025-09-20 19:19:57 +02:00
parent 53af71a9a1
commit 9dae7ff75d
5 changed files with 31 additions and 10 deletions

View File

@@ -17,7 +17,11 @@ impl PostEntry {
pub fn to_html(self) -> Result<Self, anyhow::Error> {
match markdown::to_html_with_options(&self.content, &markdown::Options::gfm()) {
Ok(content) => Ok(Self { content, ..self }),
Ok(mut content) => {
content = content.replace("<table>", r#"<div class="table-wrapper"><table>"#);
content = content.replace("</table>", r#"</table></div>"#);
Ok(Self { content, ..self })
}
Err(e) => anyhow::bail!(e),
}
}