Skip to content

Commit 917b01e

Browse files
committed
Merge branch 'develop'
2 parents 6527148 + e96351b commit 917b01e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

markdownify/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from bs4 import BeautifulSoup, NavigableString, Comment
1+
from bs4 import BeautifulSoup, NavigableString, Comment, Doctype
22
import re
33
import six
44

@@ -124,7 +124,7 @@ def is_nested_node(el):
124124

125125
# Convert the children first
126126
for el in node.children:
127-
if isinstance(el, Comment):
127+
if isinstance(el, Comment) or isinstance(el, Doctype):
128128
continue
129129
elif isinstance(el, NavigableString):
130130
text += self.process_text(el)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
pkgmeta = {
1111
'__title__': 'markdownify',
1212
'__author__': 'Matthew Tretter',
13-
'__version__': '0.8.0',
13+
'__version__': '0.8.1',
1414
}
1515

1616

tests/test_advanced.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ def test_code_with_tricky_content():
2121
assert md('<code>/home/</code><b>username</b>') == "`/home/`**username**"
2222
assert md('First line <code>blah blah<br />blah blah</code> second line') \
2323
== "First line `blah blah \nblah blah` second line"
24+
25+
26+
def test_special_tags():
27+
assert md('<!DOCTYPE html>') == ''
28+
assert md('<![CDATA[foobar]]>') == 'foobar'

0 commit comments

Comments
 (0)