Backtick bug

The sequence (`)
–that is, open paren, backtick, close paren
where the parentheses are in No Style but the backtick is in Code Span style
when compiled to epub, results in (```)
This is on a Mac running Mojave, Scrivener 3.2.2.

I have tried this in three different Scrivener files, using two different formats–the standard one for novels, and one I have created for technical books, so it should be easy to reproduce. The error does not occur when compiling to PDF.

The problem is more general–it appears in other places where the backtick is in Code Span style. Possibly not everywhere; I’m not doing extensive checking, just fixing it where it appears in my book.

FWIW, I’m using backticks because I’m writing a book on JavaScript, which is a programming language that makes use of backticks.

My most recent discovery is that if I have a Code Span inside a Code Block (admittedly, that doesn’t make sense), the Code Span gets surrounded by backticks in the ePub output.

There is exactly one mention of backticks in the Scrivener manual, in a section on MultiMarkdown (which I don’t use). It says:

That is at least consistent with where I noticed it; thank goodness it doesn’t happen everywhere I use Code Span.

My guess is that some programmer thought, “Nobody will every use backticks in a book, so I can use it as a marker for something in my code.”

Yes, backticks are the marker (many flavours of) markdown use for code font.

Normally you can ‘escape’ them, by putting a backslash in front (i.e. ` will produce a standard backtick, not trigger a change in font).

If you’re only using backticks literally in the text, could you test ` to see whether that satisfies the Scrivener compiler? If it works. then you can set up an automatic replacement in the compiler so you won’t have to keep remembering to escape them in the text.