Markdown: MarkdownRenderer, MarkdownEditor, highlights and block ranges read with markdown-rs
The tree comes from markdown::to_mdast with GitHub's flavor and math. References resolve against their definitions, an image splits its paragraph, a one-line $$ formula stands as a block. BlockEditor's import and export keep pulldown-cmark. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bd014707fd
commit
fcad0ff8e9
6 files changed
+333
-282
No files matched your search
@@ -5,7 +5,7 @@ use gpui::{
|
||||
IntoElement, ParentElement, RenderOnce, SharedString, StrikethroughStyle, Styled, StyledText,
|
||||
UnderlineStyle, Window, div, prelude::*,
|
||||
};
|
||||
use pulldown_cmark::Alignment;
|
||||
use markdown::mdast::AlignKind;
|
||||
|
||||
use super::tree::{Inline, Node, Style, parse};
|
||||
use crate::{
|
||||
@@ -291,10 +291,10 @@ impl Draw<'_> {
|
||||
.flex()
|
||||
.px_3()
|
||||
.py_1p5()
|
||||
.when(aligns.get(column) == Some(&Alignment::Right), |cell| {
|
||||
.when(aligns.get(column) == Some(&AlignKind::Right), |cell| {
|
||||
cell.justify_end()
|
||||
})
|
||||
.when(aligns.get(column) == Some(&Alignment::Center), |cell| {
|
||||
.when(aligns.get(column) == Some(&AlignKind::Center), |cell| {
|
||||
cell.justify_center()
|
||||
})
|
||||
.when(header, |cell| {
|
||||
|
||||
Reference in new issue
Block a user