Skip to content

Commit 2baeabb

Browse files
authored
Correctly highlight links without suffix (#380)
This is a revert of ad853fe. The original changes in ad853fe claimed to be in service of this snippet: Here is some mono space linked text: [`project`](https://github.com/vim-pandoc/vim-pandoc-syntax). If I put here more `mono spaced` text, afterwards, the rest of the document is highlited wrong, try it yourself. This snippet highlights completely fine, even without the changes made in ad853fe. On the other hand, this change prevents this snippet from highlighting the `[anchor]` inside the sentence: This is an [anchor] tag that should be auto-linked. [anchor]: https://example.com I would love to revert the original change. Reverting it seems purely additive to me (does not break old behaviors, adds new behaviors).
1 parent 1b77f00 commit 2baeabb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syntax/pandoc.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ call s:WithConceal('image', 'syn match pandocImageIcon /!\[\@=/ display', 'conce
318318
" }}}3
319319

320320
" Definitions: {{{3
321-
syn region pandocReferenceDefinition start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend
321+
syn region pandocReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend
322322
syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=pandocReferenceDefinition display
323323
syn match pandocReferenceDefinitionAddress /:\s*\zs.*/ contained containedin=pandocReferenceDefinition
324324
syn match pandocReferenceDefinitionTip /\s*".\{-}"/ contained containedin=pandocReferenceDefinition,pandocReferenceDefinitionAddress contains=@Spell,pandocAmpersandEscape

0 commit comments

Comments
 (0)