Decode the puzzle attribution before inserting it - #78
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #77, same article. The attribution line under "What's on Tea-V?" renders its own markup as visible text:
The attribution is authored as HTML — it carries a link to the generator — and WordPress inserted it as-is, which is what
puzzlemeEmbeddoes. But only WordPress-era bodies hold that markup raw: a post written in the CMS editor stores the shortcode with the attribution entity-encoded (<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/hecomes along becauseshortcodes.tsis the first TypeScript module to importhe— the existing caller is plain JS, soastro checknever had to resolve its types before.astro check: 0 errors.🤖 Generated with Claude Code