yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.93k stars 325 forks source link

Markdown code block containing SVG incorrectly highlighted #1470

Open thdoan opened 1 month ago

thdoan commented 1 month ago

What's the problem

The code block is incorrectly highlighted.

What's the expected result

The code block should be highlighted correctly.

How to reproduce

  1. Enter this code block:
<div class="q-checkbox cursor-pointer no-outline row inline no-wrap items-center q-checkbox--dense" tabindex="0" role="checkbox" aria-label="Orange" aria-checked="false">
  <div class="q-checkbox__inner relative-position non-selectable q-checkbox__inner--falsy" aria-hidden="true">
    <input class="hidden q-checkbox__native absolute q-ma-none q-pa-none" type="checkbox" />
    <div class="q-checkbox__bg absolute">
      <svg class="q-checkbox__svg fit absolute-full" viewBox="0 0 24 24">
        <path class="q-checkbox__truthy" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
        <path class="q-checkbox__indet" d="M4,14H20V10H4"></path>
      </svg>
    </div>
  </div>
  <span class="no-outline" tabindex="-1"></span>
  <div class="q-checkbox__label q-anchor--skip">Orange</div>
</div>
  1. Observe the issue in screenshot below.

image

Other information

Version: 1.94.0 (user setup) Commit: d78a74bcdfad14d5d3b1b782f87255d802b57511 Date: 2024-10-02T13:08:12.626Z 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.19045