Use raw_link instead of path for regular links.

This commit is contained in:
Tom Alexander 2023-10-29 09:31:00 -04:00
parent 8d9a50226a
commit d9a3b13780
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
<a href="{path}">{#.children}{>object/}{/.children}</a>
<a href="{.raw_link}">{#.children}{>object/}{/.children}</a>

View File

@ -12,7 +12,7 @@ use super::RenderObject;
#[serde(tag = "type")]
#[serde(rename = "regular_link")]
pub(crate) struct RenderRegularLink {
path: String,
raw_link: String,
children: Vec<RenderObject>,
}
@ -37,7 +37,7 @@ impl RenderRegularLink {
};
Ok(RenderRegularLink {
path: regular_link.path.clone(),
raw_link: regular_link.raw_link.clone(),
children,
})
}

View File

@ -5,7 +5,7 @@ use super::IObject;
#[derive(Debug)]
pub(crate) struct IRegularLink {
pub(crate) path: String,
pub(crate) raw_link: String,
pub(crate) children: Vec<IObject>,
}
@ -22,7 +22,7 @@ impl IRegularLink {
ret
};
Ok(IRegularLink {
path: original.path.as_ref().to_owned(),
raw_link: original.get_raw_link().into_owned(),
children,
})
}