documents: inline formats toggle as Typora's

MarkdownDocument::format toggles bold, italic, code, strike, underline,
link and image at the selection, or clears every inline mark from the
blocks it touches, following Typora's toggleStyle: off inside the style,
wrap a selection, take the caret's word or write an empty pair. Code,
math, HTML and front matter refuse, as does a selection crossing a
block, a link or another mark. An open block keeps its field open.

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 11:51:24 -04:00
1 parent c35fdac2e3
commit 68d33b4c54
8 files changed
+680 -5

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ mod stack;
pub use blocks::{AlertKind, DocumentHeading, alert, is_toc};
use html_block::html_block_text;
pub use sources::Escapes;
pub(crate) use sources::lines_at;
pub(crate) use sources::{inside, lines_at};
use stack::close;
/// How a stretch of inline text prints.