fix: keep tag/filter doc warnings on their own line on hover#1215
Merged
graygilmore merged 1 commit intoMay 29, 2026
Merged
Conversation
fd4a93b to
b393efb
Compare
Contributor
Author
|
I have signed the CLA! |
graygilmore
reviewed
May 28, 2026
Contributor
graygilmore
left a comment
There was a problem hiding this comment.
Thank you Ryan! This has annoyed me for quite some time but I haven't got around to fixing it 😄
Would you mind rebasing with main? I've made a change to our CI workflow so that we can approve it to run in outside contributor PRs like yours.
Doc admonitions (e.g. the `image_url` filter's Caution/Note blockquotes) were collapsed onto the previous line on hover. `sanitize()` replaced "newline(s) + escaped >" with a single space, flattening multi-line blockquotes into the surrounding text. Drop that lossy replace so the existing `>` -> `>` conversion preserves them as markdown blockquotes, which both the VS Code hover and CodeMirror render on their own lines. Fixes Shopify#506
b393efb to
e7226d8
Compare
Contributor
Author
|
Thanks @graygilmore! Rebased onto the latest |
graygilmore
approved these changes
May 29, 2026
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.
What are you adding in this PR?
Fixes #506.
When a Liquid tag/filter's documentation contains a warning (a
> Caution:/> Note:blockquote in the source docs), the hover tooltip flattened it onto the previous line, so the warning ran into the surrounding text and was easy to miss (theimage_urlfilter is the example in the issue).The cause is in
MarkdownRenderer.sanitize():The docs HTML-escape
>to>, so blockquote lines start with>. The first replace swallows the newline together with the>marker and substitutes a single space — collapsing a multi-line blockquote into the preceding paragraph.The fix drops that lossy first replace. The existing
>→>conversion on the next line then preserves the admonition as a proper markdown blockquote, which both the VS Code hover renderer and CodeMirror render on their own lines.It's a one-line removal (plus a regression test and a changeset).
Tophatting
Rendered hover markdown for the
image_urlfilter, before and after (focused on the warning region):Before — warning collapsed into the bullet list / prose:
After — warnings preserved as blockquotes on their own lines:
MarkdownRenderer.spec.ts(built from the realimage_urldoc markup). Happy to add a VS Code hover screenshot too if you'd prefer that over the rendered-string comparison.Before you deploy
changesetA note for reviewers
I render the warnings as markdown blockquotes (
> …). I couldn't tell from the history why the original code stripped the>marker, so if you'd rather these warnings render as plain paragraphs instead of blockquotes, I'm happy to adjust — the key fix is just not collapsing them onto the previous line.🤖 Disclosure: this change was investigated and drafted with AI assistance (Claude Code). I've reviewed the diff, understand the root cause, and verified it against the repo's test suite — the test plan and reasoning are mine to defend.