Move trailing whitespace parsing to a separate element.
I still need to parse the line break at the end of elements.
This commit is contained in:
@@ -77,6 +77,15 @@ pub fn blank_line(input: &str) -> Res<&str, &str> {
|
||||
recognize(tuple((space0, alt((line_ending, eof)))))(input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
pub fn element_trailing_whitespace<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: &'s str,
|
||||
) -> Res<&'s str, &'s str> {
|
||||
start_of_line(context, input)?;
|
||||
alt((eof, recognize(many0(blank_line))))(input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
pub fn trailing_whitespace(input: &str) -> Res<&str, &str> {
|
||||
alt((eof, recognize(tuple((line_ending, many0(blank_line))))))(input)
|
||||
|
||||
Reference in New Issue
Block a user