Default coloring for triple MD back-ticks

I’ve been thinking - maybe it would be more practical to have no colors by default?
The logic/rules are simple:

  • if you do not want colors just use triple backticks without type
  • if you do want syntax high-lighting specify a type explicitly
1 Like

Your proposal is exactly the default Discourse behavior, and that’s how it was setup for a while on the forum, but unfortunately this resulted in the vast majority of Zig code blocks not being highlighted. So the reasoning behind the current setting of Zig as default is based on the following observations:

  1. This is a forum focused mainly on the Zig language so most code blocks consist of Zig code.
  2. Most users do not specify a language for their code blocks after the opening backticks.
  3. Making Zig the default language will thus cover the most common code block use case.

I understand that simply being explicit each time we add a code block would eliminate any syntax highlighting mismatches and make this a non-issue, but this is a situation similar to writing tests and making backups: we all know we should do it for our own good, but yet we don’t.

Ok.
If I do not want coloring what type/language should I use then?

You can specify text as the language after the backticks:

const std = @import("std");

pub fn main() void {}

No type/lang after opening triple back-ticks → no colors is more logical than current settings.

Ok, will try not to forget this. :slight_smile:

Mr. Spock would agree that most humans are highly illogical. :smile:

I’m not a fan of “Star trek” :slight_smile: Never watched it, honestly.
Bit of offtopic - my zig syntax colors for mcedit

1 Like