pandoc-xnos icon indicating copy to clipboard operation
pandoc-xnos copied to clipboard

Extended regex to work with pandoc version 3

Open nandokawka opened this issue 1 year ago • 6 comments

The regex check only allows for pandoc versions 2.X. This creates an error for all people upgrading to pandoc versions 3.X.

nandokawka avatar Feb 15 '23 09:02 nandokawka

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.

slowkow avatar Apr 13 '23 18:04 slowkow

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

bvorak avatar Apr 19 '23 20:04 bvorak

Hi @tomduck could I please ask if you plan to merge this PR? Thank you!

slowkow avatar Apr 20 '23 14:04 slowkow

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.

tompollard avatar May 17 '23 19:05 tompollard

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...

bollenn avatar Aug 02 '23 06:08 bollenn

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.

ivanperez-keera avatar Sep 12 '23 23:09 ivanperez-keera