aboutsummaryrefslogtreecommitdiffstats
path: root/renderer/src/html.rs
diff options
context:
space:
mode:
Diffstat (limited to 'renderer/src/html.rs')
-rw-r--r--renderer/src/html.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/renderer/src/html.rs b/renderer/src/html.rs
index 706ec2f..fe934e7 100644
--- a/renderer/src/html.rs
+++ b/renderer/src/html.rs
@@ -9,6 +9,7 @@ use failure::Error;
use document_tree::{
Document,Element,HasChildren,ExtraAttributes,
elements as e,
+ extra_attributes as a,
element_categories as c,
};
@@ -172,8 +173,9 @@ impl_html_render_cat!(BodyElement { Paragraph, LiteralBlock, DoctestBlock, MathB
impl_html_render_simple!(Paragraph => p, LiteralBlock => pre, MathBlock => math, Rubric => a, Compound => p, Container => div, BulletList => ul["\n"], EnumeratedList => ol["\n"], DefinitionList => dl["\n"], FieldList => dl["\n"], OptionList => pre, LineBlock => div["\n"], BlockQuote => blockquote, Admonition => aside, Attention => aside, Hint => aside, Note => aside, Caution => aside, Danger => aside, Error => aside, Important => aside, Tip => aside, Warning => aside, Figure => figure);
impl_html_render_simple_nochildren!(Table => table); //TODO: after implementing the table, move it to elems with children
-//impl<I> HTMLRender for I where I: e::Element + a::ExtraAttributes<a::Image>
-macro_rules! impl_render_html_image { ($t:ty) => { impl HTMLRender for $t {
+// circumvent E0119
+trait IMark {} impl IMark for e::Image {} impl IMark for e::ImageInline {}
+impl<I> HTMLRender for I where I: e::Element + a::ExtraAttributes<a::Image> + IMark {
fn render_html<W>(&self, renderer: &mut HTMLRenderer<W>) -> Result<(), Error> where W: Write {
let extra = self.extra();
if let Some(ref target) = extra.target {
@@ -193,9 +195,7 @@ macro_rules! impl_render_html_image { ($t:ty) => { impl HTMLRender for $t {
}
Ok(())
}
-}}}
-impl_render_html_image!(e::Image);
-impl_render_html_image!(e::ImageInline);
+}
impl HTMLRender for e::DoctestBlock {
fn render_html<W>(&self, _renderer: &mut HTMLRenderer<W>) -> Result<(), Error> where W: Write {