Edit posts
Use fix routes for user profile edit handles to make it easier when user decides to change his username
This commit is contained in:
@@ -14,13 +14,9 @@ impl PostEntry {
|
||||
self.published_at.format("%B %d, %Y").to_string()
|
||||
}
|
||||
|
||||
pub fn to_html(self) -> Result<Self, anyhow::Error> {
|
||||
pub fn to_html(&self) -> anyhow::Result<String> {
|
||||
match markdown::to_html_with_options(&self.content, &markdown::Options::gfm()) {
|
||||
Ok(mut content) => {
|
||||
content = content.replace("<table>", r#"<div class="table-wrapper"><table>"#);
|
||||
content = content.replace("</table>", r#"</table></div>"#);
|
||||
Ok(Self { content, ..self })
|
||||
}
|
||||
Ok(content) => Ok(content),
|
||||
Err(e) => anyhow::bail!(e),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user