diff --git a/src/parse/mod.rs b/src/parse/mod.rs index b473c9af0..86d18cbac 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -285,7 +285,7 @@ fn heading(p: &mut Parser, at_start: bool) { while p.eat_if(NodeKind::Eq) {} if at_start && p.peek().map_or(true, |kind| kind.is_space()) { - p.eat_while(|kind| kind.is_space()); + p.eat_while(|kind| kind == &NodeKind::Space(0)); markup_line(p); marker.end(p, NodeKind::Heading); } else { diff --git a/tests/ref/structure/heading.png b/tests/ref/structure/heading.png index 3e12b2cf4..7ad228ab3 100644 Binary files a/tests/ref/structure/heading.png and b/tests/ref/structure/heading.png differ diff --git a/tests/ref/structure/list.png b/tests/ref/structure/list.png index 7a60e1e55..5d0f03c00 100644 Binary files a/tests/ref/structure/list.png and b/tests/ref/structure/list.png differ diff --git a/tests/typ/structure/heading.typ b/tests/typ/structure/heading.typ index de95c35b4..496181bd0 100644 --- a/tests/typ/structure/heading.typ +++ b/tests/typ/structure/heading.typ @@ -1,5 +1,11 @@ // Test headings. +--- +#show node: heading as text(blue, node.body) + += +No heading + --- // Different number of equals signs. diff --git a/tests/typ/structure/list.typ b/tests/typ/structure/list.typ index 77e153c76..5c410a3f3 100644 --- a/tests/typ/structure/list.typ +++ b/tests/typ/structure/list.typ @@ -1,5 +1,9 @@ // Test lists. +--- +- +No list + --- _Shopping list_ #list(attached: true)[Apples][Potatoes][Juice]