rufuspollock/markdown2latex

Error in mdx_latex.py, line 169: 'Registry' object does not support item assignment

MariosGkMeng opened this issue · 4 comments

When I try to run:

import markdown
import mdx_latex

# text is input string ...
md = markdown.Markdown()
latex_mdx = mdx_latex.LaTeXExtension()
latex_mdx.extendMarkdown(md, markdown.__dict__) # <--- line that triggers the error

It gives me the following error:

Exception has occurred: TypeError
'Registry' object does not support item assignment
  File "<path>\markdown2latex\mdx_latex.py", line 169, in extendMarkdown
    md.treeprocessors['latex'] = latex_tp
  File "<path>\markdown2latex\markdownToLatex.py", line 7, in <module>
    latex_mdx.extendMarkdown(md, markdown.__dict__)

Thanks for reporting. Can you provide details of python version etc.

Yes:

  • Python 3.10
  File "<path>/mdx_latex.py", line 150, in extendMarkdown
    md.treeprocessors['latex'] = latex_tp
TypeError: 'Registry' object does not support item assignment

got same error, Python 3.9.2

I suspect this is fixed by #19 which i just merged. Would be nice if someone could fix the tests ...

If it is still broken let me know.