diff options
author | Sebastian Wiesner <sebastian@swsnr.de> | 2019-03-26 07:54:17 +0100 |
---|---|---|
committer | Sebastian Wiesner <sebastian@swsnr.de> | 2019-03-26 07:54:17 +0100 |
commit | b9adc3599a5a28ffc71313870531ab360c083e58 (patch) | |
tree | 9be1801e3658283f08df22d44cab9417806771bc | |
parent | a81471778edb7c04ae70e2ec28d25d66d8f09253 (diff) |
Handle HTML block start and end
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -489,7 +489,6 @@ fn write_event<'io, 'c, 'l, W: Write>( Start(tag) => start_tag(ctx, tag), End(tag) => end_tag(ctx, tag), Html(content) => { - ctx.newline()?; let html_style = ctx.style.current.fg(Colour::Green); for line in content.lines() { ctx.write_styled(&html_style, line)?; @@ -512,7 +511,7 @@ fn start_tag<'io, 'c, 'l, W: Write>( tag: Tag<'l>, ) -> Result<Context<'io, 'c, 'l, W>, Error> { match tag { - HtmlBlock => panic!("mdcat does not support HTML blocks"), + HtmlBlock => ctx.newline()?, Paragraph => ctx.start_inline_text()?, Rule => { ctx.start_inline_text()?; @@ -661,7 +660,7 @@ fn end_tag<'io, 'c, 'l, W: Write>( tag: Tag<'l>, ) -> Result<Context<'io, 'c, 'l, W>, Error> { match tag { - HtmlBlock => panic!("mdcat does not support HTML blocks"), + HtmlBlock => {} Paragraph => ctx.end_inline_text_with_margin()?, Rule => ctx.end_inline_text_with_margin()?, Header(_) => { |