Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Commit

Permalink
Fix #127 (#128)
Browse files Browse the repository at this point in the history
* Fix #127

* fix flake8
  • Loading branch information
cgabard authored Dec 1, 2016
1 parent 171cc98 commit 05996db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion markdown/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 16)
version_info = (2, 6, 0, 'zds', 17)


def _get_version():
Expand Down
6 changes: 5 additions & 1 deletion markdown/extensions/smart_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def run(self, parent, blocks):
# Should not happen
return False
if m.group("txtlegend") is None:
ml = self.legend_re.match(blocks[0])
if blocks:
ml = self.legend_re.match(blocks[0])
else:
ml = None

if ml:
blocks.pop(0)
alt = m.group(1)
Expand Down
12 changes: 12 additions & 0 deletions tests/test_zds.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ def test_inline_mode(self):
md.convert('> ![Image](http://test.com/image.png)'),
'<p>&gt;&#x202F;![Image](http://test.com/image.png)\n</p>')

def test_img_in_block(self):

zds_ext = ZdsExtension(emoticons={":D": "image.png"})
md = markdown.Markdown(extensions=[zds_ext])

self.assertEqual(
md.convert('[[secret]]\n| ![Image utilisateur](http://www.glovedgirl.fr/Avatars/avatar-6.jpg)'),
'<div class="spoiler">\n'
'<figure><img alt="" src="http://www.glovedgirl.fr/Avatars/avatar-6.jpg">'
'<figcaption>Image utilisateur</figcaption>\n'
'</figure>\n</div>')

def test_ping_function(self):
def ping_url(user=None):
if user == 'Clem':
Expand Down

0 comments on commit 05996db

Please sign in to comment.