Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/crates/monolith-server/src/routes/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3619,7 +3619,19 @@ pub async fn sitemap(State(state): State<Arc<AppState>>, site: SiteCtx) -> impl
.unwrap_or_default();
rows.into_iter()
.filter_map(|(slug, title, content)| {
let embeds = find_youtube_embeds(&content);
// `posts.content` is stored as TipTap JSON, block JSON, or
// a JSON-string-quoted HTML literal. Apply the same fallback
// chain as the post handlers before scanning for iframes —
// raw `posts.content` has `\"` in place of `"`, so the iframe
// attribute parser would never match.
let html = if let Some(h) = monolith_core::blocks::try_render_tiptap(&content) {
h
} else if let Some(blocks) = monolith_core::blocks::parse_blocks(&content) {
monolith_core::blocks::render_blocks(&blocks)
} else {
monolith_core::blocks::unwrap_json_string(&content)
};
let embeds = find_youtube_embeds(&html);
if embeds.is_empty() {
None
} else {
Expand Down
Loading