Allow :: to end links regardless of parenthesis.
This commit is contained in:
@@ -285,17 +285,9 @@ fn file_path_reg<'b, 'g, 'r, 's>(
|
||||
take,
|
||||
)),
|
||||
parser_with_context!(text_until_exit)(&parser_context),
|
||||
opt(map(
|
||||
tuple((
|
||||
tag("::"),
|
||||
verify(rest, |search_option| {
|
||||
Into::<&str>::into(search_option)
|
||||
.chars()
|
||||
.any(char::is_alphanumeric)
|
||||
}),
|
||||
)),
|
||||
|(_, search_option)| search_option,
|
||||
)),
|
||||
opt(map(tuple((tag("::"), rest)), |(_, search_option)| {
|
||||
search_option
|
||||
})),
|
||||
)))(input)?;
|
||||
|
||||
Ok((
|
||||
@@ -447,11 +439,10 @@ fn path_reg_end(
|
||||
fn impl_path_reg_end<'b, 'g, 'r, 's>(
|
||||
_context: RefContext<'b, 'g, 'r, 's>,
|
||||
input: OrgSource<'s>,
|
||||
starting_parenthesis_depth: BracketDepth,
|
||||
_starting_parenthesis_depth: BracketDepth,
|
||||
enable_search_option: bool,
|
||||
) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let current_depth = input.get_parenthesis_depth() - starting_parenthesis_depth;
|
||||
if enable_search_option && current_depth == 0 {
|
||||
if enable_search_option {
|
||||
let search_option = peek(tag("::"))(input);
|
||||
if search_option.is_ok() {
|
||||
return search_option;
|
||||
|
||||
Reference in New Issue
Block a user