""" Test whitelisting/blacklisting of specific tags. """ from markdownify import markdownify, LSTRIP, RSTRIP, STRIP from .utils import md def test_strip(): text = md('Some Text', strip=['a']) assert text == 'Some Text' def test_do_not_strip(): text = md('Some Text', strip=[]) assert text == '[Some Text](https://github.com/matthewwithanm)' def test_convert(): text = md('Some Text', convert=['a']) assert text == '[Some Text](https://github.com/matthewwithanm)' def test_do_not_convert(): text = md('Some Text', convert=[]) assert text == 'Some Text' def test_strip_document(): assert markdownify("

Hello

") == "Hello" # test default of STRIP assert markdownify("

Hello

", strip_document=LSTRIP) == "Hello\n\n" assert markdownify("

Hello

", strip_document=RSTRIP) == "\n\nHello" assert markdownify("

Hello

", strip_document=STRIP) == "Hello" assert markdownify("

Hello

", strip_document=None) == "\n\nHello\n\n"