Port upstream reference linked image click fix#74
Open
Renakoni wants to merge 1 commit into
Open
Conversation
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.
Upstream
Ports marktext/marktext#4866: marktext/marktext#4866
This is stacked on #73 (
sync/upstream-4858-linked-image-modifier-click) because upstream #4866 depends on #4858's exportedLINK_SELECTOR, linked-image modifier-click guard, and linked-image regression test.Android relevance
Android carries the same Muya inline tokenizer, image renderer, CSS, and image/link click handlers. Reference-linked README badges (
[][ref]) and raw-HTML linked images can appear in Markdown edited on Android, so the same rendering and event behavior applies in the WebView editor.Changes
reference_linktokenization to capture image link text, so[][ref]becomes one reference link wrapping the image instead of a bare image plus fragmented reference link.spaninstead of nestedaelements, preventing invalid<a>inside<a>markup when an image is inside a real reference/raw-HTML anchor.a.mu-image-icon-*to.mu-image-icon-*to match the new span controls.Verification
pnpm --dir third_party/muya exec vitest run src/inlineRenderer/__tests__/referenceLinkImageAnchor.spec.ts src/selection/__tests__/linkedImageClick.spec.ts src/selection/__tests__/rawHtmlLinkedImageClick.spec.tspnpm build