From f0b5fd080fb99d9a37a195758bb75994e788c815 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Tue, 30 Jul 2019 20:14:42 +0200 Subject: Fix compiler errors New version promoted Code to an event --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d860b86..496b0fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -476,6 +476,10 @@ fn write_event<'io, 'c, 'l, W: Write>( ctx.newline_and_indent()?; Ok(ctx) } + Code(code) => { + ctx.write_highlighted(code)?; + Ok(ctx) + } Text(text) => { // When we wrote an inline image suppress the text output, ie, the // image title. We do not need it if we can show the image on the @@ -598,10 +602,6 @@ fn start_tag<'io, 'c, 'l, W: Write>( let style = ctx.style.current.bold(); ctx.set_style(style) } - Code => { - let style = ctx.style.current.fg(Colour::Yellow); - ctx.set_style(style) - } Link(_, destination, _) => { // Do nothing if the terminal doesn’t support inline links of if `destination` is no // valid URL: We will write a reference link when closing the link tag. @@ -717,7 +717,7 @@ fn end_tag<'io, 'c, 'l, W: Write>( ctx.drop_style(); ctx.style.emphasis_level -= 1; } - Strong | Code => ctx.drop_style(), + Strong => ctx.drop_style(), Link(_, destination, title) => { if ctx.links.inside_inline_link { match ctx.output.capabilities.links { -- cgit v1.2.3