Skip to content

dos/bat/cmd Disk switch "D:" destroys highlight #4134

Open
@krilbe

Description

@krilbe

Describe the issue
If the code snippet contains a disk switch line, e.g. "D:", the subsequent highlight becomes all red. It seems to be connected with the colon.
bild

Which language seems to have the issue?
"dos"

Seems to be the same with tags "bat" and "cmd".

Seems to work the same with and without space between ``` and the language tag.

Here in GitHub it seems to work correctly with tag "bat", see below under "Expected behavior".

Are you using highlight or highlightAuto?
Not sure. I was using this in an Azure DevOps Wiki page.

Sample Code to Reproduce

triplebacktick dos
rem This highlight works.
copy file.txt other.txt 
rem After next line it becomes all red.
D:
cd "D:\Folder"
md Tmp
del Tmp\*.* /q
triplebacktick

Expected behavior
The highlight should work normally even after a disk switch command, as here in GitHub:

rem This highlight works.
copy file.txt other.txt 
rem After next line it becomes all red.
D:
cd "D:\Folder"
md Tmp
del Tmp\*.* /q

Additional context
Found and tested in an Azure DevOps Wiki page, which seems to point to this repo in the docs: https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#code-highlighting

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions