@@ -213,7 +213,7 @@ class MarkdownConverter(object):
|
||||
n = int(m.group(1))
|
||||
|
||||
def convert_tag(el, text, convert_as_inline):
|
||||
return self.convert_hn(n, el, text, convert_as_inline)
|
||||
return self._convert_hn(n, el, text, convert_as_inline)
|
||||
|
||||
convert_tag.__name__ = 'convert_h%s' % n
|
||||
setattr(self, convert_tag.__name__, convert_tag)
|
||||
@@ -311,7 +311,8 @@ class MarkdownConverter(object):
|
||||
|
||||
convert_kbd = convert_code
|
||||
|
||||
def convert_hn(self, n, el, text, convert_as_inline):
|
||||
def _convert_hn(self, n, el, text, convert_as_inline):
|
||||
""" Method name prefixed with _ to prevent <hn> to call this """
|
||||
if convert_as_inline:
|
||||
return text
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ def test_hn():
|
||||
assert md('<h5>Hello</h5>') == '\n##### Hello\n\n'
|
||||
assert md('<h6>Hello</h6>') == '\n###### Hello\n\n'
|
||||
assert md('<h10>Hello</h10>') == md('<h6>Hello</h6>')
|
||||
assert md('<hn>Hello</hn>') == md('Hello')
|
||||
|
||||
|
||||
def test_hn_chained():
|
||||
|
||||
Reference in New Issue
Block a user