documents: shortcodes read per DOM text node as GitHub reads them; HTML5's p closers end a p; a TOC press follows editor anchors
- The first `:name:`-shaped run in a text node decides for the whole node: blank text or a space before it turns every shortcode, else none. Filtered tags are text and do not split the node. Probed on GitHub's markdown API. - `fieldset`, `menu` and the rest of HTML5's list end an open `p`. - `CodeEditor` carries owner anchors through each edit; the document anchors every heading it reads, and a TOC press goes where its anchor went. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a744316274
commit
8e5dad8177
12 files changed
+396
-138
No files matched your search
@@ -316,6 +316,9 @@ impl MarkdownDocument {
|
||||
let old = self.parsed.blocks.len();
|
||||
self.list
|
||||
.splice(head..old - tail, read.blocks.len() - head - tail);
|
||||
let headings: Vec<usize> = read.headings.iter().map(|heading| heading.at).collect();
|
||||
self.editor
|
||||
.update(cx, |editor, _| editor.set_anchors(headings));
|
||||
self.parsed = Arc::new(read);
|
||||
cx.emit(DocumentEvent::Parsed);
|
||||
cx.notify();
|
||||
|
||||
Reference in new issue
Block a user