summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wiesner <sebastian@swsnr.de>2019-07-30 20:14:42 +0200
committerSebastian Wiesner <sebastian@swsnr.de>2019-07-30 20:14:42 +0200
commitf0b5fd080fb99d9a37a195758bb75994e788c815 (patch)
tree6f696533ecfa8b67087e26642cd1f0c25a95d4f9
parent2adc7c3e0ce63618ffae67e386eaf65f4bb4e172 (diff)
Fix compiler errors
New version promoted Code to an event
-rw-r--r--src/lib.rs10
1 files 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 {