Inline code markdown `single backticks` don't work?


I find that single backticks for inline code don’t work for me, but triple backticks do.

Inline code with backticks

# code block
print '3 backticks or'
print 'indent 4 spaces'

Is it just me?

Edit: OK, so single backticks produce a proportional font, but it doesn’t highlight the code.

Welcome to the forum. :wave:t4:

I assume you’re talking about the formatting of the posts in this forum, right? What exactly do you want to achieve? The available options are limitted. But Inline code works just as expected, I’d say.

Thanks for the reply.

During the introductory tour on first sign in, there was a link provided to Markdown Reference, with inline and block code displayed as…


How I see the code displayed in the PowerShell forum using Firefox dark theme…

In GitHub…

I guess I see what you mean. The color scheme used for this forum does not make the inline code that obvious. It’s a kind of subtle. :wink:

The combination of 2 dark themes seems to give the best visibility for inline code

… and it will look like this:

I think subtle is an understatement :stuck_out_tongue_winking_eye: especially when the dark theme body text background is 0x333131 and the inline code background is 0x333333 ¯\(ツ)/¯. Oh well.

For a bit of fun I found a way to override this and put together a quick script to change the settings. You should close all instances of FireFox before running the script.

It should only update the default FireFox profile and if you already have custom settings it should append these settings, not overwrite the current files. Even so, use it at your own risk.

I’ve used var(--highlight) which is defined in each theme’s color_definitions.scss file and for demo purposes provides a lot of contrast :sunglasses:. You can use right-click | Inspect to view the various definitions; alternatively, use the colour name or RGB value.

$cssContent = @'
@-moz-document domain( {
    p > code,
    li > code,    
    pre > code {background: var(--highlight) !important;}

$preferenceContent = @'
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);

$profileFolder = Get-ChildItem $env:APPDATA\Mozilla\Firefox\Profiles | 
    Sort-Object LastWriteTime -Descending | Select-Object -First 1

$cssPath = "$($profilefolder.FullName)\chrome\userContent.css"

$preferencePath = "$($profilefolder.FullName)\user.js"

if (-not(Test-Path $cssPath)) {
    New-Item -ItemType File -Path $cssPath -Force | Out-Null

Add-Content -Path $cssPath -Value $cssContent

if (-not(Test-Path $cssPath)) {
    New-Item -ItemType File -Path $preferencePath -Force | Out-Null

Add-Content -Path $preferencePath -Value $preferenceContent
1 Like

Very nice!! :+1:t4: :+1:t4: :clap:t4:

Outch outch outch … :scream: :wink:

When I finally managed to re-attach my retina I figured a setting I could live with. :smirk: Unfortunately the browser I use does not support a UserContent.css stylesheet. :man_shrugging:t4:

@matt-bloomfield A little easier with the Firefox Stylus Addon :+1: