vim-patch:1aa68df: runtime(pandoc): update YAML metadata block parsing in compiler runtime

Previously the incorrect regexp forced title to be a single letter
because of using '+' instead of the '\+' regexp modifier.

closes: vim/vim#17321

1aa68dffbf

Co-authored-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
This commit is contained in:
Christian Clason
2025-05-16 09:03:47 +02:00
committed by Christian Clason
parent 2fda267faf
commit 469541c415

View File

@ -2,6 +2,7 @@
" Compiler: Pandoc " Compiler: Pandoc
" Maintainer: Konfekt " Maintainer: Konfekt
" Last Change: 2024 Nov 19 " Last Change: 2024 Nov 19
" 2025 May 15 Update the title regex for CompilerSet #17321
" "
" Expects output file extension, say `:make html` or `:make pdf`. " Expects output file extension, say `:make html` or `:make pdf`.
" Passes additional arguments to pandoc, say `:make html --self-contained`. " Passes additional arguments to pandoc, say `:make html --self-contained`.
@ -51,7 +52,7 @@ endfunction
execute 'CompilerSet makeprg=pandoc'..escape( execute 'CompilerSet makeprg=pandoc'..escape(
\ ' --standalone'.. \ ' --standalone'..
\ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ? \ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s\+\S\+', 'cnw') > 0)) ?
\ '' : ' --metadata title=%:t:r:S').. \ '' : ' --metadata title=%:t:r:S')..
\ ' '..s:PandocLang().. \ ' '..s:PandocLang()..
\ ' --from='..s:PandocFiletype(&filetype).. \ ' --from='..s:PandocFiletype(&filetype)..