Does Syntax highlighting only work on fenced code blocks but not indented code blocks?

It can work for both, depending on settings. Here on meta default code lang is text and autohighlight all code is false, so indented code is never highlighted and fenced code only when a language is specified.

// A Hello World! program in C#.
using System;
namespace HelloWorld
{
    class Hello 
    {
        static void Main() 
        {
            Console.WriteLine("Hello World!");

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
    }
}
4 Likes