documents: block commands keep text, tasks and list items whole

Round-1 fixes for R4.7: a caret in heading marks splits at the text; a
split closes and reopens bold, italic and strike, refusing inside links,
code, math and HTML; a task's first text takes no block; retype keeps
task boxes and code indent and takes siblings past the list; an alert
in an item keeps the item's opener; paragraph-before moves a holder's
first text below its opener; delete keeps neighbors from joining; a
heading's text keeps closing hashes and block openers escaped; a heading
level is idempotent, as Typora's menu calls it.

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 14:08:40 -04:00
1 parent 58e212d4ec
commit b37031b00b
9 files changed
+438 -153

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ fn block(node: &Node) -> bool {
}
/// A styled node's two marks, kept text between.
fn marks(node: &Node, text: &str) -> Option<[Range<usize>; 2]> {
pub(super) fn marks(node: &Node, text: &str) -> Option<[Range<usize>; 2]> {
let whole = span(node);
let inner = match node {
Node::Strong(_) | Node::Emphasis(_) | Node::Delete(_) => content(node),