You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Uppercase HTML named entities are not decoded in meta-fetcher #314
Describe the bug
The decodeEntities function in src/lib/meta-fetcher.ts fails to decode uppercase HTML entities such as &, ", and <. The regex matches these entities, but the lookup fails because the entity names are not converted to lowercase
To Reproduce
Steps to reproduce the behavior:
Run the following code:
import { parseMetaTags } from '@/lib/meta-fetcher';
const tags = parseMetaTags(
'<title>Tom & Jerry</title>',
'https://example.com'
);
console.log(tags.title);2. Click on '...'
Check the output.
Expected behavior
The title should be decoded correctly: Tom & Jerry
Actual behavior
The output retains the uppercase entity instead of decoding it: Tom & Jerry
Hey @anurag2787, confirmed too, with one note on the fix: entity names are case-sensitive, and HTML only has uppercase forms of &, <, > and " (there's no &APOS; or &NBSP;). So add those four to NAMED_ENTITIES rather than lowercasing the name, or &Amp; and &NBSP; would get decoded when browsers leave them alone. You're at two with #304 and #313 right now, so this one's yours once #312 is merged, just say so here.
Activity
anurag2787 commentedon Oct 29, 2026
Hi @anurag629 if this issue is valid can I work on it?
anurag629 commentedon Oct 29, 2026
Hey @anurag2787, confirmed too, with one note on the fix: entity names are case-sensitive, and HTML only has uppercase forms of
&,<,>and"(there's no&APOS;or&NBSP;). So add those four toNAMED_ENTITIESrather than lowercasing the name, or&Amp;and&NBSP;would get decoded when browsers leave them alone. You're at two with #304 and #313 right now, so this one's yours once #312 is merged, just say so here.srikar-naidu commentedon Oct 29, 2026
@anurag629 @anurag2787 , can i take this if it's free
anurag2787 commentedon Oct 30, 2026
Hi @anurag629 could you please assign this to me now?
anurag629 commentedon Oct 30, 2026
Hey @srikar-naidu, this one's going to @anurag2787 since they found it, sorry.
anurag2787 commentedon Oct 30, 2026
Hi @anurag629 you forgot to assign me but i raised a PR for it #317
anurag629 commentedon Oct 30, 2026
Sorry about that @anurag2787, assigned now. I'll look at #317 next.