microsoft / vscode-markdown-tm-grammar

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

Syntax highlights parenthetical title text containing parenthesis incorrectly #108

Closed CAD97 closed 2 years ago

CAD97 commented 2 years ago

Issue Type: Bug

Create a markdown file:

[link](target (and title (text) with parenthesis)), more text and [another link](target (with title text)).

The resulting syntax highlighting:

image

Scope inspector:

image

Per the CommonMark spec parenthesized title text must not contain unescaped ( or ) characters, so this should not be parsed as a link.

Interestingly, the preview panel correctly does not render this as a link:

image

VS Code version: Code - Insiders 1.67.0-insider (72b4be55fad0d41092d7df8e03b5597c715fd2e2, 2022-04-22T06:27:20.290Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 3700X 8-Core Processor (16 x 3593)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.95GB (18.87GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30422396 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 pythondataviewer:30285072 vscod805:30301674 pythonvspyt200:30323110 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 wslgetstarted:30449409 pythonvspyt640:30438691 vscscmwlcmt:30465136 cppdebug:30475216 pynewfile477:30451556 ```
mjbvz commented 2 years ago

Fixed by 69d3321b4923ca2d5e8e900018887cc38b5fe04a

Screen Shot 2022-06-03 at 12 42 36 PM