server: improve cloudflare and grafana image and iframe rendering

This commit is contained in:
2024-09-01 11:05:07 -07:00
parent 7218c13b9e
commit fdaff70231
2 changed files with 82 additions and 53 deletions

View File

@@ -176,6 +176,10 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
let body_tranformers: Vec<Box<dyn Transformer>> = vec![
Box::new(SlurpContents {
site_selectors: hashmap![
"blog.cloudflare.com".to_string() => vec![
Selector::parse(".author-lists").unwrap(),
Selector::parse(".post-full-content").unwrap()
],
"hackaday.com".to_string() => vec![
Selector::parse("div.entry-featured-image").unwrap(),
Selector::parse("div.entry-content").unwrap()