Automatic code highlighting, do you want it or not

Based on below, a poll

The point is that auto-detecting a language is not always reliable.

  • If no language is specified with code tags, try to detect the language and apply syntax highlighting.
  • If no language is specified with code tags, don't apply syntax highlighting at all.

0 voters

1 Like

The votes are in :wink: I've now closed the poll.

An overwhelming majority is against automatic syntax highlighting if no language is specified.

@ArduinoTeam, please draw your conclusions.

I use Geany and it work great!

This topic is about automatic code highlighting here on the forum. Like this:

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Looks pretty, right?

but sometimes we post things that aren't code in code blocks and they get detected as some random language and highlighted nonsensically:

exit status 1
'x' was not declared in this scope

I think, that is highlighted nicely. Maybe except for "this". The Arduino IDE should do that instead of orange-on-black. :slight_smile:

Maybe we need a new poll to see whether we want "universal highlighting"
for all text on the forum?