fix: support name attribute when extracting HTML meta tags#5822
fix: support name attribute when extracting HTML meta tags#5822mango766 wants to merge 1 commit intousememos:mainfrom
Conversation
The extractMetaProperty function only checked for the property attribute in HTML meta tags, which is used for Open Graph (og:title, og:image etc). Standard HTML meta tags like <meta name="description" content="..."> use the name attribute instead, so descriptions were never extracted from pages that don't use Open Graph markup.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #5821
Problem
The
extractMetaPropertyfunction inplugin/httpgetter/html_meta.goonly matched meta tags with thepropertyattribute (used by Open Graph), but standard HTML meta descriptions use thenameattribute:As a result, link previews would silently drop the description for any page that doesn't use Open Graph markup.
Fix
Add
attr.Key == "name"as an alternative toattr.Key == "property"in the attribute check:This is a one-line change that makes the extractor match both standard HTML and Open Graph meta tags.
Summary by CodeRabbit
Release Notes