Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended regex to work with pandoc version 3 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nandokawka
Copy link

@nandokawka nandokawka commented Feb 15, 2023

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

@slowkow
Copy link

slowkow commented Apr 13, 2023

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.

@bvorak
Copy link

bvorak commented Apr 19, 2023

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

@slowkow
Copy link

slowkow commented Apr 20, 2023

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

@tompollard
Copy link

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.

@bollenn
Copy link

bollenn commented Aug 2, 2023

Just ran into tomduck/pandoc-eqnos#68 which gets fixed by this PR, I would be very interested in seeing this being released...

@ivanperez-keera
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants