Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
This repository was 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

Description

@Imh0t3b

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 -->

Activity

  1. codygray commented on Jan 10, 2020

    @codygray

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions