From f05c93d2b19d0bc8297a70832574786f453ef3f8 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Mon, 16 Mar 2026 15:08:08 +0800 Subject: [PATCH] fix(zhihu): remove noscript tags to prevent duplicate images Zhihu HTML structure includes noscript fallback images:
After fixing lazy-load (replacing src with data-actualsrc), both imgs have real URLs, causing duplicates. The fix removes noscript tags before processing img elements. Co-Authored-By: Claude Opus 4.6 --- .../debug/zhihu-article-images-missing.md | 29 ++++++++++++++----- kb-zhihu-metadata/markdown_converter.py | 7 +++++ .../test_markdown_converter.py | 24 +++++++++++++++ 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/.planning/debug/zhihu-article-images-missing.md b/.planning/debug/zhihu-article-images-missing.md index 31b548b..ddb1492 100644 --- a/.planning/debug/zhihu-article-images-missing.md +++ b/.planning/debug/zhihu-article-images-missing.md @@ -2,21 +2,29 @@ status: awaiting_human_verify trigger: "知乎文章处理时图片链接丢失" created: 2026-03-15T00:00:00Z -updated: 2026-03-15T00:03:00Z +updated: 2026-03-16T00:00:02Z --- ## Current Focus -hypothesis: ROOT CAUSE CONFIRMED - 知乎懒加载图片的 src 属性是 SVG 占位符,真实 URL 在 data-actualsrc 属性中 -test: 已验证 markdownify 只读取 src 属性,得到无效的 SVG 占位符 -expecting: 修改 markdown_converter.py 处理知乎懒加载图片 -next_action: 修复 markdown_converter.py,提取真实图片 URL +hypothesis: 图片重复是因为知乎 HTML 包含