documents: format refuses ends in marks, clears more, reads long texts apart

Unwrap and merge check the original ends against marks and link
addresses. Blocks take text up to their end spaces; a cell between its
pipes. Clear also takes inline math's dollars, footnote brackets and
escape backslashes. Underline finds its <u> pair past other tags. Blank
lines split on CR too; a selection across blocks says Across. Past
128 KiB the toggle runs off the UI thread and lands only if text and
selection are unchanged; past the largest read it refuses (TooLong).
Clear and the document command move into format/.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-14 12:16:09 -04:00
1 parent 68d33b4c54
commit d238e3b4f0
6 files changed
+395 -166

No files matched your search

+2
View File
@@ -87,6 +87,7 @@ pub struct MarkdownDocument {
/// Text changes counted; a read of an older one lapses.
edits: u64,
_parsing: Option<Task<()>>,
_formatting: Option<Task<()>>,
list: ListState,
open: Option<Open>,
/// A top line asked for, until the view holds it.
@@ -158,6 +159,7 @@ impl MarkdownDocument {
parsed: Arc::default(),
edits: 0,
_parsing: None,
_formatting: None,
list: ListState::new(1, ListAlignment::Top, overdraw),
open: None,
top: None,