MarkdownDocument: a Markdown file in one CodeEditor, shown visual, source, split or preview
Visual draws the top-level blocks in a gpui list; a pressed block opens as its source and its typing is the text at once, written back as one undo step. CodeEditor takes the owner's line colors, resets with a fresh history and keeps at most 64 MiB of undo text. MarkdownMode gains Preview. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9036c92442
commit
2b6f5513aa
19 files changed
+1267
-86
No files matched your search
@@ -23,6 +23,13 @@ pub(crate) fn tree(text: &str) -> mdast::Node {
|
||||
markdown::to_mdast(text, &options()).expect("markdown without MDX always parses")
|
||||
}
|
||||
|
||||
/// A whole file as a syntax tree: front matter too.
|
||||
pub(crate) fn file_tree(text: &str) -> mdast::Node {
|
||||
let mut options = options();
|
||||
options.constructs.frontmatter = true;
|
||||
markdown::to_mdast(text, &options).expect("markdown without MDX always parses")
|
||||
}
|
||||
|
||||
/// The bytes of the source a parsed node spans.
|
||||
pub(crate) fn span(node: &mdast::Node) -> Range<usize> {
|
||||
let at = node.position().expect("a parsed node has its position");
|
||||
|
||||
Reference in new issue
Block a user