Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Wrong highlighting on stackoverflow.com vba if default is used #606

Open
Imh0t3b opened this issue Jan 7, 2020 · 1 comment
Open

Wrong highlighting on stackoverflow.com vba if default is used #606

Imh0t3b opened this issue Jan 7, 2020 · 1 comment

Comments

@Imh0t3b
Copy link

Imh0t3b commented Jan 7, 2020

If there are multiple languages specified, the default highlighting is used, what looks awful with vba, especially if single-quotes are contained.
See https://stackoverflow.com/q/59558043/9439330

I would suggest using first tag with code hint as default language for site or create a default language specifier, e.g <!-- language-site: lang-vb -->

@codygray
Copy link

First off, this is not a Prettify bug; it's a Stack Exchange-specific issue. These should be posted on https://meta.stackoverflow.com.

Second, there's not a whole lot we can really do when there are multiple tags, each implying their own syntax-highlighting scheme. The [vba] tag is already set to assume "lang-vb" for syntax highlighting, but the [sql] tag also appears on that question, and it is set to assume "lang-sql". When a conflict occurs, as you said, Stack Overflow reverts to the "default" syntax highlighting, which is...not great. But how could it be?

Stack Overflow does allow you to work around this problem using an explicit syntax-highlighting hint. The format is:

<!-- language: lang-vb -->

right above the code block, or:

<!-- language-all: lang-vb -->

to affect the entire post.

See also Syntax highlighting for code in the Help Center.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants