diff --git a/markdownify/__init__.py b/markdownify/__init__.py index c2e2ec0..6d93e47 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -5,7 +5,7 @@ import six convert_heading_re = re.compile(r'convert_h(\d+)') line_beginning_re = re.compile(r'^', re.MULTILINE) -whitespace_re = re.compile(r'[\r\n\s\t ]+') +whitespace_re = re.compile(r'[\t ]+') html_heading_re = re.compile(r'h[1-6]') diff --git a/tests/test_basic.py b/tests/test_basic.py index 78775b6..bf25ee0 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -10,4 +10,4 @@ def test_soup(): def test_whitespace(): - assert md(' a b \n\n c ') == ' a b c ' + assert md(' a b \t\t c ') == ' a b c ' diff --git a/tests/test_conversions.py b/tests/test_conversions.py index 2896322..4cf05ff 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -110,6 +110,10 @@ def test_hn(): assert md('

Hello

') == '### Hello\n\n' assert md('
Hello
') == '###### Hello\n\n' +def test_hn_chained(): + assert md('

First

\n

Second

\n

Third

', heading_style=ATX) == '# First\n\n\n## Second\n\n\n### Third\n\n' + assert md('X

First

', heading_style=ATX) == 'X# First\n\n' + def test_hn_nested_tag_heading_style(): assert md('

A

P

C

', heading_style=ATX_CLOSED) == '# A P C #\n\n'