What I’m trying to do
I’d like to include backslashes in in-line code chunks that look the same as other code chunks in the Live Preview and in Reading view. I’m making a doc about regex patterns, and want to type things like A\d
. This behaves normally in Reading mode, but in Live Preview, the slash is missing.
Things I have tried
- Escaping the slash is ineffective. Double slashes (
\\
) disappear in Live Preview, and both slashes appear in Reading view. - The HTML
code
tag: Typing<code>A\d</code>
works in tables in Live Preview and anywhere in reading mode, but does not style correctly outside of tables in Live Preview. - Copying the CSS classes found via the developer panel,
<span class="cm-inline-code cm-list-1">A\b</span>
works for Live Preview but not for Reading view. <code><span class="cm-inline-code cm-list-1">A\b</span></code>
does style the text in both Live Preview and Reading view, but the code chunk font size appears noticeably smaller when used in tables.
I realize that I could use #2 in tables and #4 outside of tables to get the desired effect, but I’m hoping that there is a simpler approach that I am missing.