1
0
Fork 0
forked from alemi/upub

fix(web): break <br> too

This commit is contained in:
əlemi 2024-05-23 23:09:11 +02:00
parent 892637db04
commit 2442872b5f
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -142,8 +142,12 @@ fn DocumentNode(obj: serde_json::Value, #[prop(optional)] depth: usize) -> impl
<a href=format!("/web/config/dev?q={s}")>{s}</a>
}.into_view()
} else {
let pretty_string = s
.replace("<br/>", "<br/>\n")
.replace("<br>", "<br>\n")
.replace('\n', &newline_replace);
view! {
"\""<span class="json-text"><i>{s.replace("<br/>", "<br/>\n").replace('\n', &newline_replace)}</i></span>"\""
"\""<span class="json-text"><i>{pretty_string}</i></span>"\""
}.into_view()
}
},