Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by rene for GCC tag affects C++ syntax highlighting

I don't think that is a bug. From What is syntax highlighting and how does it work?

If there's more than one tag that has syntax highlighting, it uses a default and lets Prettify infer what's the best language to use.

That question has multiple tags with a language hint on it (scroll to the end of the wiki):

has no language hint.

This means Prettify falls back to the Default which is all possible keywords of major languages smashed together. I explained more in depth how that works here.

If you want proper highlighting add the explicit prettifier to use <!-- language: lang-cpp --> or <!-- language: lang-c --> above the relevant code blocks.

Or even better: Don't mix C and C++, ever.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>