Files
orca/src/renderer
Brennan Benson ed2135d248 Preserve original markdown style when editing in the rich editor (#8862)
* Preserve original markdown style when editing in the rich editor

The rich markdown editor re-serialized the whole document into a canonical
style on the first edit, so a one-character change rewrote every non-canonical
construct (`_x_`->`*x*`, `__x__`->`**x**`, `* item`->`- item`, dropped trailing
newline) and produced a large, unexpected diff.

Reconcile the canonical getMarkdown() output back toward the original source
bytes at every disk-bound serialize site (debounced autosave, flush, Cmd/Ctrl+S)
so untouched regions keep their markup and only the edited region changes. A
divergent-base fuzzy patch (diff-match-patch) carries the user's edit onto the
original style; a safety re-parse requires the result to render-equal what the
editor shows, else it falls back to today's canonical output — so content
semantics can never change. The rich editor stays the default for markdown.

Fixes #6080

* Bound markdown reconciliation diff work
2026-07-15 13:33:11 -07:00
..
2026-03-17 01:40:24 -07:00
2026-05-30 13:09:17 -07:00