Do not strip "//" from plain link path.

This commit is contained in:
Tom Alexander
2023-10-08 09:28:09 -04:00
parent ba8115c648
commit 1bbe8fc688
2 changed files with 14 additions and 3 deletions

View File

@@ -133,6 +133,7 @@ fn pathreg<'b, 'g, 'r, 's>(
Ok((remaining, path))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn parse_path_reg<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -188,6 +189,7 @@ enum ParserState {
Percent,
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn apply_link_templates<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -247,6 +249,7 @@ fn apply_link_templates<'b, 'g, 'r, 's>(
Some(ret)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn file_path_reg<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -305,6 +308,7 @@ fn file_path_reg<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn id_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
let (remaining, (raw_link, (_, path))) = consumed(tuple((tag("id:"), rest)))(input)?;
Ok((
@@ -319,6 +323,7 @@ fn id_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn custom_id_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
let (remaining, (raw_link, (_, path))) = consumed(tuple((tag("#"), rest)))(input)?;
Ok((
@@ -333,6 +338,7 @@ fn custom_id_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn code_ref_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
let (remaining, (raw_link, (_, path, _))) = consumed(tuple((
tag("("),
@@ -351,6 +357,7 @@ fn code_ref_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn protocol_path_reg<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -372,6 +379,7 @@ fn protocol_path_reg<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn fuzzy_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
let (remaining, body) = rest(input)?;
Ok((