Repository navigation
fix(remark-snackplayer): avoid double-decoding metadata - #5324
Merged
Merged
Conversation
parseParams already decodes each SnackPlayer meta value, and the plugin decoded name, description and ext a second time, so an encoded % sequence in a value (such as %2520) was turned into a different character. Use the parsed values as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Hey @ZainnQureshii, can you link the page on which you see mentioned |
Contributor
Author
|
Hey, no page hits it right now, all 2,274 SnackPlayer blocks in the docs only use |
Simek
approved these changes
Nov 11, 2026
Simek
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for catching that edge case, and the fix! 👍
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.
Summary
URLSearchParamsalready decodes metadata inplugins/remark-snackplayer/src/index.ts:15, so the second decode madename=100%25%20readythrowURIError: URI malformed.Use the parsed values directly at
plugins/remark-snackplayer/src/index.ts:36,:37and:38, keeping the existingExample,Example usageandtsxfallbacks. The name above now producesdata-snack-name="100% ready"without rejecting Markdown processing.For input
literal%20%2520%20text, the plugin's generated name and description attributes now containliteral %20 textinstead ofliteral text. The serialized filename is likewiseApp.literal %20 textinstead ofApp.literal text. These claims cover generated metadata, and do not establish Expo iframe behavior or successful bundling of percent-bearing filenames.Test plan
Run from the repository root, using isolated dependencies with direct runtime, TypeScript, formatter and lint-tool versions matched to
yarn.lock:yarn --cwd plugins/remark-snackplayer test: with production fix reverted and regression tests kept, exit 1, 2 passed and 6 failed. With only the extension decode restored, exit 1, 6 passed and 2 failed. With the full fix, exit 0, 8 passed and 0 failed.yarn --cwd plugins/remark-snackplayer test: with only the original fixture tests, exit 0, 2 passed and 0 failed. Regression tests were restored afterward.yarn prettier --check plugins/remark-snackplayer/src/index.ts plugins/remark-snackplayer/tests/index.ts: exit 0, both files pass.yarn eslint plugins/remark-snackplayer/src/index.ts plugins/remark-snackplayer/tests/index.ts: exit 0, no lint diagnostics.yarn --cwd plugins/remark-snackplayer lint: exit 2 before and after the production fix, with the same TS2769 visitor type incompatibility atvisit()(old line 90, new line 88). The chained ESLint step is not reached.git diff --check: exit 0.Full website build and live Expo behavior were not tested.
Changelog:
[Internal] [Fixed] - Avoid decoding SnackPlayer metadata twice during Markdown processing.
Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot.
🤖 Generated with Claude Code