File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1+ |build | |version | |license | |downloads |
2+
3+ .. |build | image :: https://img.shields.io/github/workflow/status/matthewwithanm/python-markdownify/Python%20application/develop
4+ :alt: GitHub Workflow Status
5+ :target: https://github.com/matthewwithanm/python-markdownify/actions?query=workflow%3A%22Python+application%22
6+
7+ .. |version | image :: https://img.shields.io/pypi/v/markdownify
8+ :alt: Pypi version
9+ :target: https://pypi.org/project/markdownify/
10+
11+ .. |license | image :: https://img.shields.io/pypi/l/markdownify
12+ :alt: License
13+ :target: https://github.com/matthewwithanm/python-markdownify/blob/develop/LICENSE
14+
15+ .. |downloads | image :: https://pepy.tech/badge/markdownify
16+ :alt: Pypi Downloads
17+ :target: https://pepy.tech/project/markdownify
18+
119Installation
220============
321
Original file line number Diff line number Diff line change 66convert_heading_re = re .compile (r'convert_h(\d+)' )
77line_beginning_re = re .compile (r'^' , re .MULTILINE )
88whitespace_re = re .compile (r'[\r\n\s\t ]+' )
9- FRAGMENT_ID = '__MARKDOWNIFY_WRAPPER__'
10- wrapped = '<div id="%s">%%s</div>' % FRAGMENT_ID
119
1210
1311# Heading styles
@@ -62,12 +60,8 @@ def __init__(self, **options):
6260 ' convert, but not both.' )
6361
6462 def convert (self , html ):
65- # We want to take advantage of the html5 parsing, but we don't actually
66- # want a full document. Therefore, we'll mark our fragment with an id,
67- # create the document, and extract the element with the id.
68- html = wrapped % html
6963 soup = BeautifulSoup (html , 'html.parser' )
70- return self .process_tag (soup . find ( id = FRAGMENT_ID ) , children_only = True )
64+ return self .process_tag (soup , children_only = True )
7165
7266 def process_tag (self , node , children_only = False ):
7367 text = ''
Original file line number Diff line number Diff line change 1010pkgmeta = {
1111 '__title__' : 'markdownify' ,
1212 '__author__' : 'Matthew Tretter' ,
13- '__version__' : '0.5.2 ' ,
13+ '__version__' : '0.5.3 ' ,
1414}
1515
1616
Original file line number Diff line number Diff line change @@ -157,3 +157,7 @@ def test_bullets():
157157def test_img ():
158158 assert md ('<img src="/path/to/img.jpg" alt="Alt text" title="Optional title" />' ) == ''
159159 assert md ('<img src="/path/to/img.jpg" alt="Alt text" />' ) == ''
160+
161+
162+ def test_div ():
163+ assert md ('Hello</div> World' ) == 'Hello World'
You can’t perform that action at this time.
0 commit comments