diff options
| author | Philipp A | 2018-12-01 16:02:51 +0100 |
|---|---|---|
| committer | Philipp A | 2018-12-01 16:02:51 +0100 |
| commit | ad225dee57c5f4f8391ba50d7da5b793f8900e8e (patch) | |
| tree | 19f300a456931d77b951c79563d4bf4850f51498 /src/document_tree/extra_attributes.rs | |
| parent | 71d26fbdc4825b4c2a2db125dde388dc5c5a196c (diff) | |
| download | rust-rst-ad225dee57c5f4f8391ba50d7da5b793f8900e8e.tar.bz2 | |
Unified image attributes
Diffstat (limited to 'src/document_tree/extra_attributes.rs')
| -rw-r--r-- | src/document_tree/extra_attributes.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/document_tree/extra_attributes.rs b/src/document_tree/extra_attributes.rs index 916ba41..2019dec 100644 --- a/src/document_tree/extra_attributes.rs +++ b/src/document_tree/extra_attributes.rs @@ -85,19 +85,10 @@ impl_extra!(TargetInline { anonymous: bool, }); impl_extra!(RawInline { space: FixedSpace, format: Vec<NameToken> }); -impl_extra!(#[derive(Debug,Serialize)] ImageInline { - #[serde(serialize_with = "serialize_url")] - uri: Url, - align: Option<AlignHV>, - alt: Option<String>, - height: Option<Measure>, - width: Option<Measure>, - scale: Option<u8>, - #[serde(serialize_with = "serialize_opt_url")] - target: Option<Url>, // Not part of the DTD but a valid argument -}); -impl ImageInline { - pub fn new(uri: Url) -> ImageInline { ImageInline { +pub type ImageInline = Image; + +impl Image { + pub fn new(uri: Url) -> Image { Image { uri: uri, align: None, alt: None, |
