Skip to content

Commit aceced6

Browse files
committed
cleaning up changes with help of linter
1 parent 3b049cd commit aceced6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

markdownify/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def escape(text):
2222
return ''
2323
return text.replace('_', r'\_')
2424

25+
2526
def chomp(text):
2627
"""
2728
If the text in an inline tag like b, a, or em contains a leading or trailing
@@ -34,6 +35,7 @@ def chomp(text):
3435
text = text.strip()
3536
return (prefix, suffix, text)
3637

38+
3739
def _todict(obj):
3840
return dict((k, getattr(obj, k)) for k in dir(obj) if not k.startswith('_'))
3941

tests/test_conversions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<li>3</li>
2222
</ul>""")
2323

24+
2425
def test_chomp():
2526
assert md(' <b></b> ') == ' '
2627
assert md(' <b> </b> ') == ' '
@@ -31,15 +32,18 @@ def test_chomp():
3132
assert md(' <b> s </b> ') == ' **s** '
3233
assert md(' <b> s </b> ') == ' **s** '
3334

35+
3436
def test_a():
3537
assert md('<a href="http://google.com">Google</a>') == '[Google](http://google.com)'
3638

39+
3740
def test_a_spaces():
3841
assert md('foo <a href="http://google.com">Google</a> bar') == 'foo [Google](http://google.com) bar'
3942
assert md('foo<a href="http://google.com"> Google</a> bar') == 'foo [Google](http://google.com) bar'
4043
assert md('foo <a href="http://google.com">Google </a>bar') == 'foo [Google](http://google.com) bar'
4144
assert md('foo <a href="http://google.com"></a> bar') == 'foo bar'
4245

46+
4347
def test_a_with_title():
4448
text = md('<a href="http://google.com" title="The &quot;Goog&quot;">Google</a>')
4549
assert text == r'[Google](http://google.com "The \"Goog\"")'
@@ -58,6 +62,7 @@ def test_a_no_autolinks():
5862
def test_b():
5963
assert md('<b>Hello</b>') == '**Hello**'
6064

65+
6166
def test_b_spaces():
6267
assert md('foo <b>Hello</b> bar') == 'foo **Hello** bar'
6368
assert md('foo<b> Hello</b> bar') == 'foo **Hello** bar'
@@ -81,6 +86,7 @@ def test_br():
8186
def test_em():
8287
assert md('<em>Hello</em>') == '*Hello*'
8388

89+
8490
def test_em_spaces():
8591
assert md('foo <em>Hello</em> bar') == 'foo *Hello* bar'
8692
assert md('foo<em> Hello</em> bar') == 'foo *Hello* bar'
@@ -130,6 +136,7 @@ def test_strong():
130136
def test_ul():
131137
assert md('<ul><li>a</li><li>b</li></ul>') == '\n* a\n* b\n\n'
132138

139+
133140
def test_inline_ul():
134141
assert md('<p>foo</p><ul><li>a</li><li>b</li></ul><p>bar</p>') == 'foo\n\n\n* a\n* b\n\nbar\n\n'
135142

0 commit comments

Comments
 (0)