Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 195

New code block design guesses incorrectly at what the language is, even when explicitly stated

$
0
0

(Cross-posted as a bug report to MSE which lists all affected languages found thus far. Please go there to see if a language you've observed being labeled incorrectly is included in the table)

I just loaded a question and saw what I assume is a new feature in code blocks where the site tells us at a glance what it thinks the language is in said code block:

Screenshot of HTML code in a question tagged 'HTML' showing 'xml' as the type of code being displayed, which is incorrect.

This question is tagged and the actual code fences explicitly state the code is HTML as well:

Screenshot of the markup showing HTML explicitly listed with the code fences

This might just be specific to HTML/XML, since other questions tagged, e.g. seem to 'guess' correctly. The question where I saw this is: Name attribute on details element

Can this please be fixed to not guess at the very least when the language is explicitly stated in the code fences, and preferably also not when a (single) language tag is used in the question?

(Or better yet, if you think you detect a language that is not tagged in the question, prompt the user to confirm whether that language is correct before allowing them to post the question, and if not, change the guess or auto-add the language tag. That would save on a fair amount of "you can't close this question as a duplicate with your gold badge because the question didn't have the correct language tag beforehand).

Another example: An / question that autodetects different code blocks as Haskell, Sass, and Rust: Find locations with the same travel time to a destination: Heatmap/Contours based on transportation time (Reverse Isochronic Contours):


Viewing all articles
Browse latest Browse all 195

Latest Images

Trending Articles



Latest Images