fix: decode html before encoding it again in db

This commit is contained in:
əlemi 2024-01-03 14:26:50 +01:00
parent 0ed8e6649f
commit 707144d169
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -83,9 +83,9 @@ async fn main() {
for sugg in current_content.iter() {
tracing::info!("inserting page {:?}", sugg);
let insert = PageInsertion {
body: sugg.body.clone(),
author: Some(sugg.author.clone()),
contact: sugg.contact.clone(),
body: html_escape::decode_html_entities(&sugg.body).to_string(),
author: Some(html_escape::decode_html_entities(&sugg.author).to_string()),
contact: sugg.contact.clone().map(|c| html_escape::decode_html_entities(&c).to_string()),
public: Some(true),
date: Some(sugg.date),
};