Repository navigation
fix(editing): hide formatting markup while editing page text (#242) - #362
Merged
DWAA1660 merged 1 commit intoNov 18, 2026
Merged
Conversation
…chSoftware#242) Normal editing now shows the rendered text — marks, link syntax, HTML tags and tag markers stay out of the editor while their formatting stays visibly applied. InlineEdit keeps the serialized spans as the document and exposes a visible-text projection; edits fold back through an LCS-aligned literal mask so stored literal punctuation keeps its identity while newly typed Markdown still parses. Inline images are one object character, caret/selection/copy/paste run on visible characters, and dialog edits (link, video) splice spans directly so removing a link works even when the visible words are unchanged.
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 and why
Editing a page showed its serialized markup —
**bold**,[text](url),<span style="...">, tag markers — as dimmed text instead of the formattedresult, so users edited source rather than words. Normal block editing now
uses a visible/source split:
InlineEditkeeps the parsedSpans as thedocument and exposes a visible-text projection to egui, so cursor, selection,
typing, copy/paste and IME all run on visible characters while markup never
enters the buffer. Edits fold back through an LCS-aligned literal mask:
stored literal punctuation (
*literal*,$5,[x](y), paths) keeps itsidentity while newly typed Markdown still parses. Formatting, link and video
dialog edits mutate spans directly — removing a link leaves identical
visible words, which a text diff could never distinguish. Inline images are
one object character, the editor layouter reuses the preview's span
formatting, and code/math blocks keep source editing. Closes #242.
Only tested on Linux.
Quality level L3 (see SKILLS/nc-devx/SKILL.md)
cargo xtask pre-pushpasses on the current branch before pushingorigin/maincoveragejob's warnings are read;cargo xtask coverage --updateis inthis pull request if coverage rose
docs/commands.md(regenerated),docs/gaps.md,docs/testing.md,docs/mcp.md,docs/control-protocol.md, as they applyCommandSpecwith a testcargo xtask demo-check, the format parity test, and a side byside look at both formats
cargo xtask screenshotsif they changedassets/ordocs/images/have a row inATTRIBUTION.mdHow it was checked
cargo test -p notecraft-ui-egui— 420 lib + 325 UI tests, 0 failures,including new regression tests for visible-run editing, literal
preservation, image atomicity, Unicode offsets and live widget typing.
cargo xtask ci— all checks passed: fmt, clippy-D warnings,workspace tests, ui-tests, i18n-audit, layers, assets, docs, text,
demo-check.
cargo xtask pre-push(run after commit, before push) andcargo xtask screenshots— the editor's visual output intentionallychanges (markup hidden, formatting shown), so screenshots should be
regenerated and reviewed before merge.