from markdownify import markdownify as md def test_chomp(): assert md(' ') == ' ' assert md(' ') == ' ' assert md(' ') == ' ' assert md(' ') == ' ' assert md(' s ') == ' **s** ' assert md(' s ') == ' **s** ' assert md(' s ') == ' **s** ' assert md(' s ') == ' **s** ' def test_nested(): text = md('

This is an example link.

') assert text == 'This is an [example link](http://example.com/).\n\n' def test_ignore_comments(): text = md("") assert text == "" def test_ignore_comments_with_other_tags(): text = md("example link") assert text == "[example link](http://example.com/)" def test_code_with_tricky_content(): assert md('>') == "`>`" assert md('/home/username') == "`/home/`**username**" assert md('First line blah blah
blah blah
second line') \ == "First line `blah blah \nblah blah` second line" def test_special_tags(): assert md('') == '' assert md('') == 'foobar'