summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wiesner <sebastian@swsnr.de>2019-03-26 07:54:17 +0100
committerSebastian Wiesner <sebastian@swsnr.de>2019-03-26 07:54:17 +0100
commitb9adc3599a5a28ffc71313870531ab360c083e58 (patch)
tree9be1801e3658283f08df22d44cab9417806771bc
parenta81471778edb7c04ae70e2ec28d25d66d8f09253 (diff)
Handle HTML block start and end
-rw-r--r--src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d1ecd5c..519ccd3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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(_) => {