Consume trailing whitespace in paragraphs.
This commit is contained in:
parent
faf2bb401d
commit
b65c2f86b5
@ -5,6 +5,7 @@ use nom::combinator::eof;
|
|||||||
use nom::combinator::map;
|
use nom::combinator::map;
|
||||||
use nom::combinator::not;
|
use nom::combinator::not;
|
||||||
use nom::combinator::recognize;
|
use nom::combinator::recognize;
|
||||||
|
use nom::multi::many0;
|
||||||
use nom::multi::many1;
|
use nom::multi::many1;
|
||||||
use nom::sequence::tuple;
|
use nom::sequence::tuple;
|
||||||
|
|
||||||
@ -53,6 +54,9 @@ fn paragraph<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, P
|
|||||||
|
|
||||||
let (remaining, children) = many1(standard_set_object_matcher)(input)?;
|
let (remaining, children) = many1(standard_set_object_matcher)(input)?;
|
||||||
|
|
||||||
|
let (remaining, _trailing_whitespace) =
|
||||||
|
alt((eof, recognize(tuple((line_ending, many0(blank_line))))))(remaining)?;
|
||||||
|
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
|
|
||||||
Ok((remaining, Paragraph { source, children }))
|
Ok((remaining, Paragraph { source, children }))
|
||||||
|
Loading…
Reference in New Issue
Block a user