remove superfluous leading/trailing whitespace (#181)
This commit is contained in:
committed by
GitHub
parent
dbb5988802
commit
ae0597d80c
@@ -2,7 +2,8 @@
|
||||
Test whitelisting/blacklisting of specific tags.
|
||||
|
||||
"""
|
||||
from markdownify import markdownify as md
|
||||
from markdownify import markdownify, LSTRIP, RSTRIP, STRIP
|
||||
from .utils import md
|
||||
|
||||
|
||||
def test_strip():
|
||||
@@ -23,3 +24,11 @@ def test_convert():
|
||||
def test_do_not_convert():
|
||||
text = md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=[])
|
||||
assert text == 'Some Text'
|
||||
|
||||
|
||||
def test_strip_document():
|
||||
assert markdownify("<p>Hello</p>") == "Hello" # test default of STRIP
|
||||
assert markdownify("<p>Hello</p>", strip_document=LSTRIP) == "Hello\n\n"
|
||||
assert markdownify("<p>Hello</p>", strip_document=RSTRIP) == "\n\nHello"
|
||||
assert markdownify("<p>Hello</p>", strip_document=STRIP) == "Hello"
|
||||
assert markdownify("<p>Hello</p>", strip_document=None) == "\n\nHello\n\n"
|
||||
|
||||
Reference in New Issue
Block a user