From 0df976288d54c7e5c5d0e92addd7419b3b8f71f6 Mon Sep 17 00:00:00 2001 From: Alexandre Constantino Date: Thu, 4 Feb 2016 11:32:20 +0000 Subject: [PATCH 1/1] Add comment on non-greedy match --- syntax/markdown.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index a897f60..994de6b 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -51,6 +51,7 @@ if get(g:, "vim_markdown_emphasis_multiline", 1) syn region htmlBoldItalic start="___\ze\S" end="\S\zs___" keepend else " single-line emphasis (emphasis only works with closing token on the same line) + " the following character makes the match non-greedy: vv syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\([^\n\*]*[^\\\*\t ]\)\?\*" end="[^\\\*\t ]\zs\*\ze\_W" keepend syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]\([^\n_]*[^\\_\t ]\)\?_" end="[^\\_\t ]\zs_\ze\_W" keepend syn region htmlBold start="\*\*\ze\S\([^\n\*]*[^\\\*\t ]\)\?\*\*" end="\S\zs\*\*" keepend -- 2.39.5