Skip to content

Commit

Permalink
Merge pull request #37 from gisce/fix_markdown_3_compat
Browse files Browse the repository at this point in the history
Fix package to work with Markdown 3.0
  • Loading branch information
jaumef committed Oct 23, 2018
2 parents b8ff644 + 1a99d96 commit 5f340dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 6 additions & 3 deletions markdown_i18n/extension.py
Expand Up @@ -11,14 +11,17 @@ def __init__(self, **kwargs):
}
self.toc_found = False
self.md = None
self.priority = 1
super(I18NExtension, self).__init__(**kwargs)

def extendMarkdown(self, md, md_globals):
md.treeprocessors.add('i18n', I18NTreeProcessor(md, self), '_end')
def extendMarkdown(self, md):
md.registerExtension(self)
md.treeprocessors.register(
I18NTreeProcessor(md, self), 'i18n', self.priority)
self.md = md

def reset(self):
if not self.toc_found and 'toc' in self.md.treeprocessors:
self.md.treeprocessors.link('i18n', '<toc')
self.md.treeprocessors.add(
'i18n', I18NTreeProcessor(self.md, self), '<toc')
self.toc_found = True
13 changes: 11 additions & 2 deletions setup.py
Expand Up @@ -3,11 +3,20 @@

setup(
name='markdown-i18n',
version='2.1.2',
version='3.0.0',
packages=find_packages(),
url='https://github.com/gisce/markdown-i18n',
license='MIT',
install_requires=['Markdown', 'babel', 'six'],
install_requires=[
'Markdown>=3',
'babel',
'six'
],
entry_point={
'markdown.extensions': [
'markdown_i18n = markdown_i18n.extension.py:I18NExtension'
]
},
author='GISCE-TI, S.L.',
author_email='devel@gisce.net',
test_suite="tests",
Expand Down

0 comments on commit 5f340dc

Please sign in to comment.