table wrapping
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user