tomduck / pandoc-eqnos

A pandoc filter for numbering equations and equation references.
GNU General Public License v3.0
221 stars 27 forks source link

TypeError: can only concatenate list (not "unicode") to list #14

Closed kdheepak closed 7 years ago

kdheepak commented 8 years ago

This seems to work fine

Then we need to install python-dev, pyspidev and BiblioPixel.

but the following fails

Then we need to install python-dev, pyspidev and BiblioPixel.

>>> pandoc content/markdown.md --filter pandoc-eqnos -o test.html
Traceback (most recent call last):
  File "/Users/$USER/miniconda2/bin/pandoc-eqnos", line 11, in <module>
    sys.exit(main())
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandoc_eqnos.py", line 231, in main
    altered)
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandoc_eqnos.py", line 229, in <lambda>
    altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocfilters.py", line 34, in walk
    array.append(walk(item, action, format, meta))
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocfilters.py", line 25, in walk
    res = action(item['t'], item['c'], format, meta)
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocxnos/core.py", line 474, in repair_refs
    _repair_refs(value)
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocxnos/core.py", line 119, in wrapper
    ret = func(*args, **kwargs)
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocxnos/core.py", line 428, in _repair_refs
    if _is_broken_ref(x[i]['t'], x[i]['c'], x[i+1]['t'], x[i+1]['c']):
  File "/Users/$USER/miniconda2/lib/python2.7/site-packages/pandocxnos/core.py", line 413, in _is_broken_ref
    s = value1[n][0]['c'] + value2
TypeError: can only concatenate list (not "unicode") to list
pandoc: Error running filter pandoc-eqnos
Filter returned error status 1

I'm using the latest version of pandoc and python 2.7

tomduck commented 8 years ago

Hi @kdheepak. Thanks for your feedback and sorry for the delay.

I just pushed out a new version, and I haven't been able to reproduce the error with it. So, either the problem is fixed or I don't understand the problem.

Here is the markdown I used:

Then we need to install `python-dev`, [`pyspidev`][1] and [`BiblioPixel`][2].

[1]: http://foo.com/

[2]: http://foo.com/

... and here is the command-line call:

$ pandoc demo.md --filter pandoc-eqnos -o demo.html

Please let me know. Cheers.

tomduck commented 8 years ago

Hi @kdheepak. I just pushed out a new version of pandoc-eqnos for the new pandoc 1.18. Can you give it a try to see if this Issue is resolved?

tomduck commented 7 years ago

Hi @kdheepak. I'm just wondering if this Issue is resolved with the new release of pandoc-eqnos? Thanks, Tom.

kdheepak commented 7 years ago

Sorry for not following up on this. I just used the latest version of pandoc-eqnos and this issue appears to be resolved! Thanks for looking into this!

tomduck commented 7 years ago

That's great news! Thanks again for your feedback, @kdheepak. Cheers, Tom.