Index | Diary

Journal 2023-11-09

Windows Desktop Background

Win11 desktop wallpaper background powershell

Bibliography Setup

citeproc pandoc Zettelkasten vim-zettel biblatex BibTeX

The version of pandoc impacts pandoc --list-extensions output.

Error detected while processing function redir#Redir[20]..pandoc#command#Pandoc:
line    4:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jdfen/.dotfiles/config/vim/vimfiles/pack/python/start/vim-pandoc/python3/vim_pandoc/command.py", line 72, in __call__
    if self.pandoc_info.is_valid_output_format(c_vars['output_format']) \
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jdfen/.dotfiles/config/vim/vimfiles/pack/python/start/vim-pandoc/python3/vim_pandoc/helpparser.py", line 99, in is_valid_output_format
    return re.match(identifier+"(([+-]("+"|".join(self.extensions)+"))+)?$", identifier)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<snip>
    raise source.error("nothing to repeat",
re.error: nothing to repeat at position 40

The error in self.extensions is caused by get_extensions() not parsing pandoc --list-extensions because the space is missing before + or -. For backwards compatibility with versions requiring the space, use Regex to replace either pattern with an empty string.

M python3/vim_pandoc/helpparser.py
@@ -80,8 +80,8 @@ class PandocInfo(object):
         return list(chain.from_iterable([v.names for v in self.options]))

     def get_extensions(self):
-        data = self.__raw_output('--list-extensions').\
-            replace(' +', '').replace(' -', '')
+        data = self.__raw_output('--list-extensions')
+        data = re.sub('(^ |^)[\+-]', '', data, flags=re.MULTILINE)
         return data.splitlines()

     def get_input_formats(self):

Github vim-pandoc Issue #457 describes the problem, and Pull Request #458 proposes the solution.

Page created on 2025-07-03