Mute a link's revealed target - #156
Merged
Merged
Conversation
With the caret inside `[text](url)`, the four brackets are tinted `mutedText` but the target between two of them keeps body color — the loudest ink in the document, on the one run that is machine-readable rather than prose, and that disappears again the moment the caret leaves. Every other construct here mutes its syntax when it reveals it: the `#` of a heading, the `>` of a quote, the list markers, and — in this very function — the brackets themselves. The target was the exception. `mutedText` is `secondaryLabelColor`, so it stays readable for editing; the label keeps the faded link ink and, as before, no `.link` attribute while active. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
luca-chen198
added a commit
to wildthink/swift-markdown-engine
that referenced
this pull request
Aug 17, 2026
nodes-app#120 landed as a squash, so its content reached main under a new sha while this branch still carries the original commits. The shared merge-base is therefore still f6137df and git saw the directive files as added on both sides. Resolution, all three mechanical: - MarkdownDirective.swift (add/add): took this branch's version, which is a strict superset of main's -- 78 lines added, none removed. - ARCHITECTURE.md, CHANGELOG.md: main contributed nothing at the conflict point (its directive text arrived with the squash, above the marker), so this branch's styling paragraphs stand as written. MarkdownASTStyler.swift auto-merged: main's link-target muting from nodes-app#156 sits in styleLink and the directive branch sits in styleInlines, on disjoint ranges.
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.
With the caret inside
[text](url), the four brackets are tintedmutedTextwhile the target between two of them keeps body colour. So the loudest ink in the document lands on the one run that is machine-readable rather than prose — and that disappears again the moment the caret leaves.Every other construct mutes its syntax when it reveals it: the
#of a heading, the>of a quote, the list markers, and — in this very function — the brackets themselves. The target was the exception.mutedTextissecondaryLabelColor, so the target stays readable for editing — recessed, not hidden. The label keeps the faded link ink, and as before carries no.linkattribute while active, so nothing inside an active link is followable.Inactive links are untouched: the target is still collapsed to the hidden-marker font and cleared.
Tests — 345 pass. The new one is mutation-proved: removing the added line makes
activeLinkTargetIsMutedfail.This mirrors a change made in the iOS port (
nodes-app/Nodes-Mobile), so both editors reveal a link the same way.🤖 Generated with Claude Code