mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 08:03:28 +00:00
* 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