Fix empty heading
This commit is contained in:
parent
1bca9ccecb
commit
15ef72cca4
@ -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 {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@ -1,5 +1,11 @@
|
||||
// Test headings.
|
||||
|
||||
---
|
||||
#show node: heading as text(blue, node.body)
|
||||
|
||||
=
|
||||
No heading
|
||||
|
||||
---
|
||||
// Different number of equals signs.
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
// Test lists.
|
||||
|
||||
---
|
||||
-
|
||||
No list
|
||||
|
||||
---
|
||||
_Shopping list_
|
||||
#list(attached: true)[Apples][Potatoes][Juice]
|
||||
|
Loading…
x
Reference in New Issue
Block a user