microsoft / vscode-markdown-tm-grammar

VS Code built-in markdown extension's Textmate grammar
MIT License
64 stars 49 forks source link

Markdown comments not highlighted correctly #167

Open thomas-philips opened 3 days ago

thomas-philips commented 3 days ago

Type: Bug

The following markdown code marks only <!-- DEF in comment color, not GHI -->.

ABC <!-- DEF GHI --> JKL

VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|13th Gen Intel(R) Core(TM) i7-13850HX (28 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.66GB (17.39GB free)| |Process Argv|--crash-reporter-id b49ad029-f07c-474b-8c72-479328e5d8d3| |Screen Reader|no| |VM|0%|
Extensions (12) Extension|Author (truncated)|Version ---|---|--- vscode-github-actions|git|0.27.0 vscode-docker|ms-|1.29.2 debugpy|ms-|2024.8.0 python|ms-|2024.4.1 vscode-pylance|ms-|2024.7.1 remote-containers|ms-|0.388.0 remote-wsl|ms-|0.88.0 cmake-tools|ms-|1.19.52 cpptools|ms-|1.22.9 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.14 cmake|twx|0.0.17 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 cp13037c-prod:31155933 vscaat:30438848 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 jg8ic977:31013176 dvdeprecation:31068756 dwnewjupyter:31046869 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 wkspc-ranged-t:31151552 defaultse:31146405 iacca1:31156133 notype1:31157159 5fd0e150:31155592 dwcopilotcf:31161678 icondisabled:31158250 ```
vs-code-engineering[bot] commented 3 days ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.94.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

thomas-philips commented 3 days ago

I updated my VS Code install, the issue remains.

RedCMD commented 2 days ago

is because paragraph cuts it off too early https://github.com/microsoft/vscode-markdown-tm-grammar/blob/2ef29be471194312a389432ebfc7d058b7f4fc0d/syntaxes/markdown.tmLanguage#L3881-L3904 not sure why only the first line doesn't need 4 spaces

adding 4 spaces at the beginning of the line fixes it Image