Skip to content

Commit

Permalink
Add None check to PrettifyTreeprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
fourpoints authored May 25, 2022
1 parent cebe1de commit 96d27f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/change_log/release-3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ The following new features have been included in the 3.4 release:
The following bug fixes are included in the 3.4 release:

* Extension entry-points are only loaded if needed (#1216).
* Added a `None` check to `PrettifyTreeprocessor` (#1261).
2 changes: 1 addition & 1 deletion markdown/treeprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,5 @@ def run(self, root):
# Clean up extra empty lines at end of code blocks.
pres = root.iter('pre')
for pre in pres:
if len(pre) and pre[0].tag == 'code':
if len(pre) and pre[0].tag == 'code' and pre[0].text is not None:
pre[0].text = util.AtomicString(pre[0].text.rstrip() + '\n')

0 comments on commit 96d27f1

Please sign in to comment.