Compare commits

..

No commits in common. "9f81116ba32c5d8372c5890f8a51f0492c5a72ec" and "905564ce1532a3d9b63cc4dac087cbdc4bb8bfeb" have entirely different histories.

3 changed files with 5 additions and 5 deletions

View file

@ -25,6 +25,7 @@ serde_json = "1"
serde_default = "0.1"
serde-inline-default = "0.2"
toml = "0.8"
mdhtml = { path = "../../utils/mdhtml", features = ["markdown"] }
uriproxy = { path = "../../utils/uriproxy" }
httpsign = { path = "../../utils/httpsign/" }
jrd = "0.1"

View file

@ -25,10 +25,10 @@ impl Normalizer for crate::Context {
async fn insert_object(&self, object: impl apb::Object, tx: &impl ConnectionTrait) -> Result<crate::model::object::Model, NormalizerError> {
let mut object_model = AP::object(&object)?;
// TOO should we make sure content only contains a safe subset of html ? frontend does it too
// if let Some(content) = object_model.content {
// object_model.content = Some(mdhtml::safe_html(&content));
// }
// make sure content only contains a safe subset of html
if let Some(content) = object_model.content {
object_model.content = Some(mdhtml::safe_html(&content));
}
// fix context for remote posts
// > if any link is broken or we get rate limited, the whole insertion fails which is

View file

@ -56,7 +56,6 @@ impl TokenSink for Sink {
match attr.name.local.as_ref() {
"href" => self.buffer.push_str(&format!(" href=\"{}\"", attr.value.as_ref())),
"title" => self.buffer.push_str(&format!(" title=\"{}\"", attr.value.as_ref())),
"class" => if attr.value.as_ref() == "u-url mention" { self.buffer.push_str(" class=\"u-url mention\"") },
_ => {},
}
}