2

I had assumed from Syntax highlighting for Fortran? on MSO and Please deploy Fortran syntax highlighting on MSE that Fortran syntax highlighting was not available on Stack Overfow.

But this question on SO has lovely Fortran syntax highlighting, using

<!-- language: lang-fortran -->

Would it be possible to roll out this syntax highlighting as default to all questions with the [fortran] tag?

4
  • Related (has the list of supported languages): What is syntax highlighting and how does it work? Dec 11, 2021 at 14:40
  • It looks like Fortran is in the Supported Languages list at highlight.js and has been for more than a year. I'm confused as to where that leaves things in the how to request a new language FAQ. Dec 11, 2021 at 14:53
  • Ok, I think I understand now. The MSE post is where things are at in the process outlined in the FAQ, and the nearly-a-year delay is because the powers that be are understandably very busy :) I've closed my question as a dupe, because I don't think it adds anything new. Dec 11, 2021 at 15:32
  • The linked Fortran question has now been deleted (RemoveAbandonedQuestions). Dec 20, 2021 at 16:31

1 Answer 1

2

It's not really that lovely.

lang-fortran doesn't exist, so it falls back to the "default" syntax highlighting, which is what you were seeing. You're now seeing exactly that same thing when I set it to lang-default. What you read about Fortran not being supported by Stack Overflow's syntax highlighting engine is correct. Although highlight.js supports it, Stack Overflow does not import it, so it doesn't work here.

I can set the syntax highlighting hint for the tag to "default", which will create the same effect. But, honestly… The default best-guess syntax highlighting is pretty lame. I guess it at least gives the code some splotches of color, which is kinda nice, but it doesn't actually understand the syntax of the code, and so the syntax highlighting is not really very useful. I consider it to be more distracting than anything.

I'll let the community weigh in on whether they think this is a good idea.

1
  • 1
    As a user who glances at fortran, I'm going to interpret "not really that lovely" as "awful, distracting, and painfully wrong at times". Dec 11, 2021 at 17:26

Not the answer you're looking for? Browse other questions tagged .