5

Take this answer where the tag VBA is used. The system recognizes the tag and automatically turns on syntax highlighting. So far so good.

Today I answered another question where no syntax highlighting was enabled. I tried to enable it myself with <!-- language: lang-VBA -->. It worked.

But they seem to be different. Here's a direct comparison:

enter image description here
via <!-- language: lang-VBA -->

enter image description here
via tag VBA

My question is: What's the reason behind this? Is it intentional?


Edit as reply @Sathya

Either I'm too dumb or we have a misunderstanding here. Let's make an experiment and play around with this answer

VBA comment: First, we insert <!-- language: lang-VBA --> and have a look at the preview after some seconds.

enter image description here

VB comment: Next we change <!-- language: lang-VBA --> to <!-- language: lang-VB -->. Wait some seconds between your actions.

enter image description here

VBA tag: In the last step, we remove the comment completely. Again, wait some seconds and click somewhere else

enter image description here

As I see it, there is no difference between applying <!-- language: lang-VBA --> or <!-- language: lang-VB -->. Both methods result in the same highlighting. Or am I blind?

In comparison the last try where nothing is inserted has a completely different result. That's where the tag VBA from the question itself takes effect

3
  • 2
    Sometimes cat-like smiley faces find really neat things. Commented Sep 18, 2014 at 17:45
  • Post the link to both your answers?
    – Sathyajith Bhat Mod
    Commented Sep 18, 2014 at 19:05
  • vba applies lang-vb not lang-VB. Case matters,
    – Sathyajith Bhat Mod
    Commented Sep 19, 2014 at 8:09

1 Answer 1

1

Since you haven't mentioned the other question, the only answer you'd posted to day was this.

On this answer, the question is tagged with . Looking at the tag definition, the syntax highlighting language is set as vb, so the prettifier <!-- language: lang-vb --> why is why you see the highlighting as in the second image.

On your today's answer, the question originally didn't have , so no syntax highlighting was applied.

Then, you forced <!-- language: lang-VBA --> which has different colour syntax highlighting than <!-- language: lang-vb --> which is applied to the first question.

hence, the difference. See the revisions here to see how the highlighting changes

2
  • Erm, I cannot reproduce nor understand this answer. You say a question tagged with VBA should give the same syntax highlightning as when inserted <!-- language: lang-VB -->? That's simply not the case
    – nixda
    Commented Sep 18, 2014 at 19:42
  • @nixda see my edit
    – Sathyajith Bhat Mod
    Commented Sep 18, 2014 at 19:59

You must log in to answer this question.

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