Remove line breaks from path and do not allow search option for protocol links.

This commit is contained in:
Tom Alexander
2023-10-08 13:02:09 -04:00
parent aa253c38dd
commit d987b9b75b
3 changed files with 33 additions and 6 deletions

View File

@@ -138,16 +138,13 @@ fn parse_protocol_angle_link<'b, 'g, 'r, 's>(
tuple((parser_with_context!(protocol)(context), tag(":"))),
|(protocol, _)| LinkType::Protocol(protocol.into()),
)(input)?;
let (remaining, path) = alt((take_until("::"), rest))(remaining)?;
let (remaining, search_option) = opt(map(tuple((tag("::"), rest)), |(_, search_option)| {
search_option
}))(remaining)?;
let (remaining, path) = rest(remaining)?;
Ok((
remaining,
PathAngle {
link_type,
path: path.into(),
search_option: search_option.map(Into::<&str>::into),
search_option: None,
application: None,
},
))