From df6b7645d845a022ca7eeba08b1ecb761a020195 Mon Sep 17 00:00:00 2001 From: Andreu Botella Botella Date: Wed, 6 Nov 2019 03:09:22 +0100 Subject: Handling relative URLs in the conversion code. Closes #10. --- src/document_tree/extra_attributes.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/document_tree/extra_attributes.rs') diff --git a/src/document_tree/extra_attributes.rs b/src/document_tree/extra_attributes.rs index e72b288..55896ab 100644 --- a/src/document_tree/extra_attributes.rs +++ b/src/document_tree/extra_attributes.rs @@ -1,6 +1,6 @@ use serde_derive::Serialize; -use crate::target; +use crate::url::Url; use super::attribute_types::{CanBeEmpty,FixedSpace,ID,NameToken,AlignHV,AlignH,AlignV,TableAlignH,TableBorder,TableGroupCols,Measure,EnumeratedListType}; pub trait ExtraAttributes { @@ -33,7 +33,7 @@ impl_extra!(SubstitutionDefinition { ltrim: bool, rtrim: bool }); impl_extra!(Comment { space: FixedSpace }); impl_extra!(Target { /// External reference to a URI/URL - refuri: Option, + refuri: Option, /// References to ids attributes in other elements refid: Option, /// Internal reference to the names attribute of another element. May resolve to either an internal or external reference. @@ -42,13 +42,13 @@ impl_extra!(Target { }); impl_extra!(Raw { space: FixedSpace, format: Vec }); impl_extra!(#[derive(Debug,PartialEq,Serialize,Clone)] Image { - uri: target::Target, + uri: Url, align: Option, alt: Option, height: Option, width: Option, scale: Option, - target: Option, // Not part of the DTD but a valid argument + target: Option, // Not part of the DTD but a valid argument }); //bools usually are XML yesorno. “auto” however either exists and is set to something random like “1” or doesn’t exist @@ -75,7 +75,7 @@ impl_extra!(OptionArgument { delimiter: Option }); impl_extra!(Reference { name: Option, //TODO: is CDATA in the DTD, so maybe no nametoken? /// External reference to a URI/URL - refuri: Option, + refuri: Option, /// References to ids attributes in other elements refid: Option, /// Internal reference to the names attribute of another element @@ -89,7 +89,7 @@ impl_extra!(Problematic { refid: Option }); //also have non-inline versions. Inline image is no figure child, inline target has content impl_extra!(TargetInline { /// External reference to a URI/URL - refuri: Option, + refuri: Option, /// References to ids attributes in other elements refid: Option, /// Internal reference to the names attribute of another element. May resolve to either an internal or external reference. @@ -100,7 +100,7 @@ impl_extra!(RawInline { space: FixedSpace, format: Vec }); pub type ImageInline = Image; impl Image { - pub fn new(uri: target::Target) -> Image { Image { + pub fn new(uri: Url) -> Image { Image { uri, align: None, alt: None, -- cgit v1.2.3