Skip to content

Commit

Permalink
remove dead commented out code and update doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed May 7, 2024
1 parent 63628d8 commit 3f82aad
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions src/parser/link_url/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,9 @@ pub struct PunycodeWarning {

impl LinkDestination<'_> {
/// parse a link that is not in a delimited link or a labled link, just a part of normal text
/// it has a whitelist of schemes, because otherwise
/*
pub(crate) fn parse_standalone_with_whitelist(
input: &str,
) -> IResult<&str, LinkDestination, CustomError<&str>> {
if let Ok((rest, link_destination)) = parse_link(input) {
if link_destination.hostname.is_none() {
// if it's a generic url like geo:-15.5,41.1
if !is_allowed_generic_scheme(link_destination.scheme) {
Err(nom::Err::Error(CustomError::InvalidLink))
} else {
Ok((rest, link_destination))
}
} else {
Ok((
rest,
link_destination
))
}
} else {
Err(nom::Err::Error(CustomError::InvalidLink))
}
}
*/
///
/// - for generic schemes (schemes without `://`) this uses a whitelist not reduce false positives
/// - it also ignores the last punctuation sign if it is at the end of the link
pub fn parse(input: &str) -> IResult<&str, LinkDestination, CustomError<&str>> {
if let Ok((rest, link_destination)) = parse_link(input) {
Ok((rest, link_destination))
Expand Down

0 comments on commit 3f82aad

Please sign in to comment.