fix: preserve literal data in multiline custom tags - #615
Draft
davidfant wants to merge 1 commit into
Draft
Conversation
Contributor
|
@davidfant is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
lofcz
added a commit
to lofcz/streamdown-ng
that referenced
this pull request
Sep 7, 2026
Exclude literalTagContent from the blank-line sandwich so entity-encoded punctuation after a bare URL stays literal JSON. Ports vercel/streamdown#615 and matches dataOnlyTags with a case-insensitive skip set.
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.
Problem
Multiline custom-tag preprocessing also processes literalTagContent tags. Its blank-line sandwich makes entity-encoded punctuation following a bare URL enter Markdown/GFM parsing. For example, a literal JSON body containing {"websites":["https://example.com"]} arrives with the closing ] still encoded and is no longer valid JSON.
Fix
Exclude explicitly literal tags from Markdown-container preprocessing. Keep existing literal escaping/restoration and normal Markdown custom-tag processing unchanged.
Validation
Added a renderer regression that fails on current main and passes with this change. 47 tests pass across custom-tag Markdown, preprocessing, and literal-content suites. Downstream reproduction: https://github.com/comp-work/monorepo/pull/1896 (private repository), where URL-bearing suggested tasks disappear while URL-free tasks survive. This source change corresponds to the downstream maintained patch; no sanitizer rules are relaxed.