diff --git a/src/documents/document/tests/open_look.rs b/src/documents/document/tests/open_look.rs index f283746..2a6dbe8 100644 --- a/src/documents/document/tests/open_look.rs +++ b/src/documents/document/tests/open_look.rs @@ -186,3 +186,10 @@ fn open_code_math_and_front_matter_keep_their_panel(cx: &mut TestAppContext) { let front = styled(TargetBlock::FrontMatter, cx).text; assert_eq!((front.color, front.font_family), (Some(muted), Some(mono))); } + +#[gpui::test] +fn open_front_matter_has_no_runs(cx: &mut TestAppContext) { + cx.update(crate::init_for_tests); + let runs = cx.update(|cx| markdown_highlights("---\ntitle: R75\n---", cx)); + assert!(runs.is_empty(), "{runs:?}"); +} diff --git a/src/documents/markdown.rs b/src/documents/markdown.rs index 1440e38..d28b6ee 100644 --- a/src/documents/markdown.rs +++ b/src/documents/markdown.rs @@ -83,7 +83,7 @@ pub(crate) fn walk<'a>(node: &'a mdast::Node, out: &mut Vec<&'a mdast::Node>) { /// The marks over `text`, with the syntax writing each. pub fn marks(text: &str) -> Vec<(Range, Mark)> { - let root = tree(text); + let root = file_tree(text); let mut nodes = Vec::new(); walk(&root, &mut nodes); let mut out = Vec::new();