Skip to main content
5 of 9
Added new info
JW0914
  • 8.6k
  • 9
  • 8

Inconsistent Windows syntax highlighting for Registry [.reg] code

(There is an intentional leading whitespace on code fence code for it to display correctly)


Updated 2024.06.25:

What is going on with this site's syntax highlighting?

  • This is an edit I just did a few min ago on the left, compared to the one on the right:
    WTF


Registry [.reg] code used to display correctly, and still does on some questions/answers, however on others it doesn't, and there's no obvious reason why. Ever since Superuser switched what's used for syntax highlighting, very few Windows syntaxes work correctly and they do not work the same across all questions/answers on Superuser, regardless of the Windows syntax used, which is baffling.

It would be nice for Superuser to embrace Windows syntax highlighting since equal amounts of content on Superuser is Windows related, as syntax primarily used on non-Windows languages always seems to work and work consistently across questions/answers.



Correctly Displayed

  1. <!-- language-all: lang-powershell -->: Will randomly display .reg code correctly on some questions/answers, but not others, whereas ```powershell code fence will not (content too long to display editor)
    Unremovable items from New right-click menu
    Correct1


  1. <!-- language-all: lang-reg -->: Will randomly display .reg code correctly on some questions/answers, but not others, same for ```reg code fence
    Set windows 10 certificate import wizard as default when opening files Correct2



Incorrectly Displayed

  1. ```reg: Will randomly display .reg code correctly on some questions/answers, but not others, same for <!-- language-all: lang-reg -->
    Create .REG file to edit only single Octet at specific address in Binary Value without affecting other bytes in binary data
    Incorrect1

    Some .exe files have blank icons on taskbar despite having icons
    Incorrect2


  1. <!-- language-all: lang-reg -->:
    Some .exe files have blank icons on taskbar despite having icons
    Incorrect3


  1. <!-- language-all: lang-powershell -->:
    Some .exe files have blank icons on taskbar despite having icons
    Incorrect4



Additional Examples:

Issue from this morning with PowerShell syntax:

  1. <!-- language-all: lang-powershell -->: incorrectly applies syntax highlighting to first code box, applies semi-correctly to every additional code box
    How can I fix this error in the DISM log file?
    Incorrect5

  2. ```powershell: incorrectly applies syntax highlighting
    How can I fix this error in the DISM log file?
    Incorrect6

    Doesn't apply syntax highlighting at all:
    How can I fix this error in the DISM log file?
    Incorrect7

  3. No language specified:
    How can I fix this error in the DISM log file?
    Incorrect8


The only way I was able to get semi-correct syntax highlighting was by using ```bash:
How can I fix this error in the DISM log file?
Incorrect9

JW0914
  • 8.6k
  • 9
  • 8