Parse out the pathreg on regular links.

This commit is contained in:
Tom Alexander
2023-10-06 17:21:43 -04:00
parent 448902bb05
commit e84135985e
4 changed files with 127 additions and 17 deletions

View File

@@ -75,6 +75,7 @@ pub use object::InlineSourceBlock;
pub use object::Italic;
pub use object::LatexFragment;
pub use object::LineBreak;
pub use object::LinkType;
pub use object::Minute;
pub use object::MinuteInner;
pub use object::Month;

View File

@@ -77,7 +77,7 @@ pub struct PlainText<'s> {
#[derive(Debug, PartialEq)]
pub struct RegularLink<'s> {
pub source: &'s str,
pub link_type: &'s str,
pub link_type: LinkType<'s>,
pub path: &'s str,
pub raw_link: &'s str,
}
@@ -638,3 +638,13 @@ impl<'s> Timestamp<'s> {
self.source.trim_end()
}
}
#[derive(Debug, PartialEq)]
pub enum LinkType<'s> {
File,
Protocol(&'s str),
Id,
CustomId,
CodeRef,
Fuzzy,
}