Skip to content

Syntax highlighting styles in inline code missing background color #207

Description

@lukasz-r

Pandoc doesn't apply full syntax highlighting styles for inline code. In particular, the background in inline code does not change. This makes inline code reading a bit difficult since it doesn't stand out from the surrounding text.

The problem didn't exist in older Pandoc versions. I'm getting this issue with 3.7.0.2 version, but can't pinpoint the exact version when the problem occured first since I've had quite a long break using Pandoc.

Here's the code:

+ let's see here: `man git`{.bash}

	+ and here:

	```bash
		man git
	```

Pandoc run for HTML:

pandoc -f markdown+backtick_code_blocks+fenced_code_attributes+inline_code_attributes -ps --highlight-style=espresso -o out.html in.md

Result: inline code is not on dark background, as opposed to code blocks:

Image

I'm attaching the input file (MRE/MWE) and Makefile for easy testing.

Details:

Pandoc 3.7.0.2
openSUSE Tumbleweed
Kernel: 6.16.3-1

in.md

Makefile:

file_in := in.md
file_out_html := out.html
file_out_pdf := out.pdf

all : out.html out.pdf

pandoc_run = pandoc -f markdown+backtick_code_blocks+fenced_code_attributes+inline_code_attributes -p $(1) --highlight-style=espresso -o $@ $<

$(file_out_html) : $(file_in)
	$(call pandoc_run,-s)
$(file_out_pdf) : $(file_in)
	$(pandoc_run)

.PHONY : clean
clean :
	$(RM) $(file_out_html) $(file_out_pdf)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions