microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.58k stars 29.03k forks source link

Markdown, code highlighted indented multi-line command (shell, using backslash, line continuation \) every 2nd line only #231408

Closed needleshaped closed 5 days ago

needleshaped commented 5 days ago

Type: Bug

  1. Open new markdown file
  2. Paste following:
echo \
ls -la \
ls -la \
  ls -la \
  ls -la \
  ls -la
tar \
    -cvzf \
    archive.tar.gz \
    file1.txt \
    file2.txt \
    file3.txt \
    file4.txt \
    file5.txt
  1. Observe highlighting applied only on every second line.
  2. Remove indent. Highlighting works now.

Screenshot below compares highlighting from Markdown code to highlighting in native shell and Markdown preview.

Image

P.S. I've found, that highlighting inside code block in Markdown is done by https://github.com/microsoft/vscode-markdown-tm-grammar

Version: 1.94.2 (user setup) Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427 Date: 2024-10-09T16:08:44.566Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

Extensions: none

needleshaped commented 5 days ago

Registered this bug in https://github.com/microsoft/vscode-markdown-tm-grammar/issues/166, after I found out that highlighting inside code block in Markdown is done by it. Correct me, if I'm wrong.

mjbvz commented 5 days ago

Closing as duplicate of the upstream issue (https://github.com/microsoft/vscode-markdown-tm-grammar/issues/166)