Add URL parsing.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use organic::types::StandardProperties;
|
||||
use url::Url;
|
||||
|
||||
use super::macros::intermediate;
|
||||
|
||||
@@ -46,6 +47,7 @@ pub(crate) enum LinkTarget {
|
||||
impl LinkTarget {
|
||||
pub(crate) fn from_string<S: AsRef<str>>(input: S) -> Result<LinkTarget, CustomError> {
|
||||
fn impl_from_string(input: &str) -> Result<LinkTarget, CustomError> {
|
||||
let parsed = Url::parse(input)?;
|
||||
Ok(LinkTarget::Raw(input.to_owned()))
|
||||
}
|
||||
impl_from_string(input.as_ref())
|
||||
|
||||
Reference in New Issue
Block a user