Consume trailing whitespace for links.
This commit is contained in:
parent
c6403423cf
commit
f9d83ee09d
@ -3,6 +3,7 @@ use nom::bytes::complete::escaped;
|
|||||||
use nom::bytes::complete::tag;
|
use nom::bytes::complete::tag;
|
||||||
use nom::bytes::complete::take_till1;
|
use nom::bytes::complete::take_till1;
|
||||||
use nom::character::complete::one_of;
|
use nom::character::complete::one_of;
|
||||||
|
use nom::character::complete::space0;
|
||||||
use nom::combinator::verify;
|
use nom::combinator::verify;
|
||||||
use nom::multi::many_till;
|
use nom::multi::many_till;
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ pub fn regular_link_without_description<'r, 's>(
|
|||||||
let (remaining, _opening_bracket) = tag("[[")(input)?;
|
let (remaining, _opening_bracket) = tag("[[")(input)?;
|
||||||
let (remaining, _path) = pathreg(context, remaining)?;
|
let (remaining, _path) = pathreg(context, remaining)?;
|
||||||
let (remaining, _closing_bracket) = tag("]]")(remaining)?;
|
let (remaining, _closing_bracket) = tag("]]")(remaining)?;
|
||||||
|
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
Ok((remaining, RegularLink { source }))
|
Ok((remaining, RegularLink { source }))
|
||||||
}
|
}
|
||||||
@ -51,6 +53,7 @@ pub fn regular_link_with_description<'r, 's>(
|
|||||||
let (remaining, _closing_bracket) = tag("][")(remaining)?;
|
let (remaining, _closing_bracket) = tag("][")(remaining)?;
|
||||||
let (remaining, _description) = description(context, remaining)?;
|
let (remaining, _description) = description(context, remaining)?;
|
||||||
let (remaining, _closing_bracket) = tag("]]")(remaining)?;
|
let (remaining, _closing_bracket) = tag("]]")(remaining)?;
|
||||||
|
let (remaining, _trailing_whitespace) = space0(remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
Ok((remaining, RegularLink { source }))
|
Ok((remaining, RegularLink { source }))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user