make convert_hn() public instead of internal (#213)
Signed-off-by: chrispy <chrispy@synopsys.com>
This commit is contained in:
committed by
GitHub
parent
2d654a6b7e
commit
e29de4e753
@@ -12,7 +12,11 @@ class UnitTestConverter(MarkdownConverter):
|
||||
|
||||
def convert_custom_tag(self, el, text, parent_tags):
|
||||
"""Ensure conversion function is found for tags with special characters in name"""
|
||||
return "FUNCTION USED: %s" % text
|
||||
return "convert_custom_tag(): %s" % text
|
||||
|
||||
def convert_hN(self, n, el, text, parent_tags):
|
||||
"""Ensure conversion function is found for headings"""
|
||||
return "convert_hN(%d): %s" % (n, text)
|
||||
|
||||
|
||||
def test_custom_conversion_functions():
|
||||
@@ -23,7 +27,9 @@ def test_custom_conversion_functions():
|
||||
assert md('<img src="/path/to/img.jpg" alt="Alt text" title="Optional title" />text') == '\n\ntext'
|
||||
assert md('<img src="/path/to/img.jpg" alt="Alt text" />text') == '\n\ntext'
|
||||
|
||||
assert md("<custom-tag>text</custom-tag>") == "FUNCTION USED: text"
|
||||
assert md("<custom-tag>text</custom-tag>") == "convert_custom_tag(): text"
|
||||
|
||||
assert md("<h3>text</h3>") == "convert_hN(3): text"
|
||||
|
||||
|
||||
def test_soup():
|
||||
|
||||
Reference in New Issue
Block a user