Skip to content

Decode the puzzle attribution before inserting it - #78

Merged
ssavutu merged 1 commit into
mainfrom
fix/puzzle-attribution-entities
Aug 7, 2026
Merged

Decode the puzzle attribution before inserting it#78
ssavutu merged 1 commit into
mainfrom
fix/puzzle-attribution-entities

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #77, same article. The attribution line under "What's on Tea-V?" renders its own markup as visible text:

Made by Coco Li using the online <a href="https://amuselabs.com/games/crossword/" target="_blank" style="color: #666666; text-decoration: underline;">cross word generator</a> from Amuse Labs

The attribution is authored as HTML — it carries a link to the generator — and WordPress inserted it as-is, which is what puzzlemeEmbed does. But only WordPress-era bodies hold that markup raw: a post written in the CMS editor stores the shortcode with the attribution entity-encoded (&lt;a href=…), so the tags and inline styles reach the page verbatim.

Decoding before insertion gives both shapes the same markup to insert. Verified against the stored body of 10092 (encoded) and a legacy-shaped shortcode (raw), where it is a no-op.

@types/he comes along because shortcodes.ts is the first TypeScript module to import he — the existing caller is plain JS, so astro check never had to resolve its types before. astro check: 0 errors.

🤖 Generated with Claude Code

The attribution is authored as HTML -- it carries a link to the puzzle
generator -- and WordPress inserted it as-is, which is what the embed
does. But only WordPress-era bodies hold that markup raw: a post written
in the CMS editor stores the shortcode with the attribution
entity-encoded, so the line under the crossword read "Made by Coco Li
using the online <a href="https://amuselabs.com/..." ...>cross word
generator</a> from Amuse Labs", tags and inline styles and all.

Decode before inserting, so both shapes contribute the same markup. On a
legacy body, which holds no entities, it is a no-op.

@types/he comes along because shortcodes.ts is the first TypeScript
module to import he; the existing caller is plain JS, so astro check
never had to resolve its types before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu merged commit 01a3f0f into main Aug 7, 2026
1 check passed
@ssavutu
ssavutu deleted the fix/puzzle-attribution-entities branch August 7, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant