pandoc-xnos
pandoc-xnos copied to clipboard
Extended regex to work with pandoc version 3
The regex check only allows for pandoc versions 2.X. This creates an error for all people upgrading to pandoc versions 3.X.
Thanks, @nandokawka for this PR.
In my experience, this PR resolves the following issue.
I used pip3 install pandoc-xnos
to install pandoc-xnos
.
Then I ran a pandoc script and got this error:
[INFO] Running filter pandoc-fignos
Traceback (most recent call last):
File "/opt/homebrew/bin/pandoc-fignos", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pandoc_fignos.py", line 608, in main
PANDOCVERSION = pandocxnos.init(args.pandocversion, doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pandocxnos/core.py", line 224, in init
_PANDOCVERSION = _get_pandoc_version(pandocversion, doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pandocxnos/core.py", line 179, in _get_pandoc_version
raise RuntimeError(msg)
RuntimeError: Cannot understand pandocversion=3.1.2
Error running filter pandoc-fignos:
Filter returned error status 1
Next, I installed the new code from this PR:
pip3 install --force-reinstall git+https://github.com/nandokawka/pandoc-xnos@284474574f51888be75603e7d1df667a0890504d#egg=pandoc-xnos
When I rerun the pandoc script, the error is gone.
i copied the above approach (thanks for that!) only actually refering to this PR here, not the one of the fork. I am no expert, but this seems more trustworthy for my personal taste:
python -m pip install --force-reinstall git+https://github.com/tomduck/pandoc-xnos@284474574f51888be75603e7d1df667a0890504d#egg=pandoc-xnos
Hi @tomduck could I please ask if you plan to merge this PR? Thank you!
Thanks @nandokawka, this also fixed the issue for me. While we're waiting for the merge, I used @bvorak's approach to install from the patched version.
Just ran into https://github.com/tomduck/pandoc-eqnos/issues/68 which gets fixed by this PR, I would be very interested in seeing this being released...
Likewise. I was just using pandoc-fignos with the latest pandoc (pandoc-3.1.4/pandoc-cli-0.1.1.1) and I hit this bug. The fix proposed worked for me. I'd be great to see it published.