mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
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) {}
|
while p.eat_if(NodeKind::Eq) {}
|
||||||
|
|
||||||
if at_start && p.peek().map_or(true, |kind| kind.is_space()) {
|
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);
|
markup_line(p);
|
||||||
marker.end(p, NodeKind::Heading);
|
marker.end(p, NodeKind::Heading);
|
||||||
} else {
|
} 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.
|
// Test headings.
|
||||||
|
|
||||||
|
---
|
||||||
|
#show node: heading as text(blue, node.body)
|
||||||
|
|
||||||
|
=
|
||||||
|
No heading
|
||||||
|
|
||||||
---
|
---
|
||||||
// Different number of equals signs.
|
// Different number of equals signs.
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
// Test lists.
|
// Test lists.
|
||||||
|
|
||||||
|
---
|
||||||
|
-
|
||||||
|
No list
|
||||||
|
|
||||||
---
|
---
|
||||||
_Shopping list_
|
_Shopping list_
|
||||||
#list(attached: true)[Apples][Potatoes][Juice]
|
#list(attached: true)[Apples][Potatoes][Juice]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user