Do not include trailing punctuation or whitespace in plain links.
This commit is contained in:
parent
66037356c5
commit
f426e32798
@ -1 +1,3 @@
|
||||
mailto:foo@bar.baz.
|
||||
|
||||
mailto:foo@bar.baz....
|
||||
|
@ -134,6 +134,7 @@ fn path_plain<'r, 's>(
|
||||
many_till(anychar, peek(exit_matcher)),
|
||||
|(children, _exit_contents)| !children.is_empty(),
|
||||
))(input)?;
|
||||
|
||||
Ok((remaining, path))
|
||||
}
|
||||
|
||||
@ -142,5 +143,10 @@ fn path_plain_end<'r, 's>(
|
||||
_context: Context<'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
recognize(one_of(" \t\r\n()[]<>"))(input)
|
||||
recognize(many_till(
|
||||
verify(anychar, |c| {
|
||||
*c != '/' && (c.is_ascii_punctuation() || c.is_whitespace())
|
||||
}),
|
||||
one_of(" \t\r\n()[]<>"),
|
||||
))(input)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user