Export to PDF makes code hard to read if exported from dark mode

Steps to reproduce

  1. Switch Obsidian to dark mode
  2. Write some text that includes backtick-delimited sections or triple-backtick sections, like this one.
  3. Export to PDF
  4. Open the PDF and notice that the backtick-delimited sections all have a dark background, even on the white background of the paper. This makes them very difficult to read.

Expected result

Text content in backticks should have a background color similar to the background color of the PDF “paper” so it’s easy to read. When doing the PDF export from Obsidian’s light mode, the backticks text is a pleasant light grey color.

Actual result

The text in backticks is on a black background. Overall, it’s a white “sheet of paper” in the PDF, with a black rectangle as the backticks text background, and red text written on it. It’s quite difficult to read.


  • Operating system: Windows 10 Pro x64 21H2 build 19044.1415
  • Debug info:
    Obsidian version: v0.13.14
    Installer version: v0.12.15
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Safe mode: on


Additional information

Here’s a screenshot from a document I wrote in dark mode and exported to PDF.

It gives me “top secret” vibes because the dark rectangles on light background look like redactions :laughing:

Here’s a screenshot from the same portion of the document, but exported to PDF from light mode instead.

Thanks for making Obsidian! I recently discovered it, and I keep finding new things it’s good at helping me do!

1 Like