Skip to content

Fix: Use self.getConfig to access a specific config value. #7

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

Merged
merged 1 commit into from
Nov 19, 2015
Merged

Fix: Use self.getConfig to access a specific config value. #7

merged 1 commit into from
Nov 19, 2015

Conversation

bjones1
Copy link

@bjones1 bjones1 commented Nov 18, 2015

This fix allows this extension to work with python-markdown v2.4, which is what ships with Ubuntu 14 LTS. Without this fix, I see:

C:\blah>python -m markdown -x enki.plugins.preview.mdx_math
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\markdown\__main__.py", line 87, in <module>
    run()
  File "C:\Python27\lib\site-packages\markdown\__main__.py", line 81, in run
    markdown.markdownFromFile(**options)
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 438, in markdownFromFile
    md = Markdown(**kwargs)
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 137, in __init__
    configs=kwargs.get('extension_configs', {}))
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 165, in registerExtensions
    ext.extendMarkdown(self, globals())
  File "C:\Users\bjones\Documents\python-markdown-math\mdx_math.py", line 38, in extendMarkdown
  File "C:\Python27\lib\site-packages\markdown\extensions\__init__.py", line 28, in getConfigs
    return dict([(key, self.getConfig(key)) for key in self.config.keys()])
AttributeError: 'list' object has no attribute 'keys'

This fix allows this extension to work with python-markdown v2.4, which is what ships with Ubuntu 14 LTS. Without this fix, I see:

C:\blah>python -m markdown -x enki.plugins.preview.mdx_math
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\markdown\__main__.py", line 87, in <module>
    run()
  File "C:\Python27\lib\site-packages\markdown\__main__.py", line 81, in run
    markdown.markdownFromFile(**options)
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 438, in markdownFromFile
    md = Markdown(**kwargs)
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 137, in __init__
    configs=kwargs.get('extension_configs', {}))
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 165, in registerExtensions
    ext.extendMarkdown(self, globals())
  File "C:\Users\bjones\Documents\python-markdown-math\mdx_math.py", line 38, in extendMarkdown
  File "C:\Python27\lib\site-packages\markdown\extensions\__init__.py", line 28, in getConfigs
    return dict([(key, self.getConfig(key)) for key in self.config.keys()])
AttributeError: 'list' object has no attribute 'keys'
bjones1 pushed a commit to bjones1/enki that referenced this pull request Nov 18, 2015
bjones1 pushed a commit to bjones1/enki that referenced this pull request Nov 18, 2015
@mitya57 mitya57 merged commit 556489a into mitya57:master Nov 19, 2015
@mitya57
Copy link
Owner

mitya57 commented Nov 19, 2015

Thanks, merged!

mitya57 added a commit to retext-project/pymarkups that referenced this pull request Dec 13, 2015
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.

2 participants