vim-markdown
vim-markdown copied to clipboard
Mistook todo checkbox as a markdown link
Environment
I use the built-in markdown plugin with gvim 9.1, without installing any third-party markdown filetype plugins.
- gvim_9.1.0309_x64_signed.exe
- Win 10 pro 22H2
Issue reproduction
-
:new -
:set filetype=markdown - Add a space (just one space) and a markdown link after a todo checkbox:
* [x] [test](https://www.example.com)
We can see vim mistook todo checkbox [x] as a markdown link, and the x will be underlined.
- More clear: If I configure augroup MarkdownLinkConceal, the todo checkbox will be concealed as if it were a markdown link. However, the [ ] symbols around test are not concealed.
augroup MarkdownLinkConceal
autocmd!
autocmd FileType markdown
\ syn region markdownLink matchgroup=markdownLinkDelimiter
\ start="(" end=")" contains=markdownUrl keepend contained conceal
autocmd FileType markdown
\ syn region markdownLinkText matchgroup=markdownLinkTextDelimiter
\ start="!\=\[\%(\_[^][]*\%(\[\_[^][]*\]\_[^][]*\)*]\%( \=[[(]\)\)\@="
\ end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite
\ contains=@markdownInline,markdownLineStart concealends
augroup END
- Compare: If there are two or more spaces after todo checkbox, the issue disappear.
* [x] [test](https://www.example.com)
Reference
- similar issue: https://github.com/nextcloud/deck/issues/2640