Skip to content

Mixed-format link labels do not enter source projection #58

Description

@Azganoth

Summary

Links whose label contains mixed inline formatting do not enter seamless source projection as one logical link object. The existing projection session model requires every text node in the active mark range to have the same supported marks, while a mixed-format link label contains a rich inline fragment with different mark combinations.

Resolving this issue depends on the generalized source-projection session engine in #63 and selection-aware exact mark-segment discovery in #68. It does not depend on #60.

Ordinary mark-segment discovery must not fragment a mixed-format link label into partial link projections. The logical-link adapter may intentionally own a mixed-format range that ordinary formatting projections would otherwise treat as separate segments.

Steps to reproduce

  1. Open a document containing [plain **bold**](https://example.com).
  2. Place the caret in either the plain or bold portion of the link label.
  3. Attempt to edit the link's Markdown source.
  4. Save and reopen the document after editing the link.

Expected behavior

  • Entering any part of the link label selects the whole logical link as the projection target, including when the caret is inside nested strong, emphasis, strikethrough, or inline-code formatting.
  • The complete link source, such as [plain **bold**](https://example.com), becomes real editable document text.
  • Valid edited source rehydrates to a rich inline fragment with one link spanning the complete mixed-format label.
  • Saving and reopening preserves one logical outer link wrapper. It must not normalize the example into adjacent links such as [plain](https://example.com) **[bold](https://example.com)**.
  • The label's supported nested formatting, destination, optional title, and compatible outer formatting are preserved.
  • Invalid or incomplete source finalizes as exact literal text without content loss.
  • Selection mapping, projection-local and native history, dirty state, target switching, and save-time serialization remain consistent with existing source projection.

Actual behavior

The link does not enter projection as one complete mixed-format object. The previous detached link-source input was removed as part of #57, leaving portions of mixed-format links without a coherent source-editing path.

The current target discovery can also prefer a nested formatting mark over the enclosing link, so entering a formatted label segment does not reliably identify the whole link as the semantic target.

Notes, logs, screenshots

Related implementation: #57.
Enabling rework: #63.
Target-discovery dependency: #68.

The current projection plugin compares mark descriptors across the active range and represents replacements as a single text + marks value. Supporting mixed-format labels requires fragment-aware target discovery, source mapping, replacement, and a link serialization strategy that preserves one logical wrapper.

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions