Drop blank lines after property drawer instead of owning them.
This commit is contained in:
parent
4e65d2cda9
commit
d0410391cc
@ -132,6 +132,7 @@ fn zeroth_section<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s
|
|||||||
&without_consuming_whitespace_context,
|
&without_consuming_whitespace_context,
|
||||||
)),
|
)),
|
||||||
parser_with_context!(property_drawer)(&without_consuming_whitespace_context),
|
parser_with_context!(property_drawer)(&without_consuming_whitespace_context),
|
||||||
|
many0(blank_line),
|
||||||
)))(input)?;
|
)))(input)?;
|
||||||
|
|
||||||
let (remaining, (mut children, _exit_contents)) = verify(
|
let (remaining, (mut children, _exit_contents)) = verify(
|
||||||
@ -141,7 +142,7 @@ fn zeroth_section<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s
|
|||||||
},
|
},
|
||||||
)(remaining)?;
|
)(remaining)?;
|
||||||
|
|
||||||
comment_and_property_drawer_element.map(|(comment, property_drawer)| {
|
comment_and_property_drawer_element.map(|(comment, property_drawer, _ws)| {
|
||||||
children.insert(0, Element::PropertyDrawer(property_drawer));
|
children.insert(0, Element::PropertyDrawer(property_drawer));
|
||||||
comment
|
comment
|
||||||
.map(Element::Comment)
|
.map(Element::Comment)
|
||||||
|
@ -3,10 +3,23 @@
|
|||||||
|
|
||||||
|
|
||||||
# Blank lines and comments can come before property drawers in the zeroth section
|
# Blank lines and comments can come before property drawers in the zeroth section
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* Spaces turn property drawers into regular drawers
|
||||||
|
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:FOO: bar
|
:FOO: bar
|
||||||
:END:
|
:END:
|
||||||
|
* Comments turn property drawers into regular drawers
|
||||||
|
# Comment
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
|
* Baseline
|
||||||
|
:PROPERTIES:
|
||||||
|
:FOO: bar
|
||||||
|
:END:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user