mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-04-30 10:51:35 +02:00
First fix for replace_br_with_p, prevent more <div> nesting, is good. DON'T try to remove previously nested div tags.
This commit is contained in:
parent
fc71ae0848
commit
732d6603d8
1 changed files with 5 additions and 6 deletions
|
|
@ -257,14 +257,13 @@ def _replace_br_with_p(body):
|
|||
body = body.strip()
|
||||
|
||||
## strip off extra <div> nestings that have built up over time.
|
||||
b='<div>'
|
||||
e='</div>'
|
||||
body = body.strip()
|
||||
while body.startswith(b) and body.endswith(e):
|
||||
body = body[len(b):-len(e)].strip()
|
||||
# b='<div>'
|
||||
# e='</div>'
|
||||
# while body.startswith(b) and body.endswith(e):
|
||||
# body = body[len(b):-len(e)].strip()
|
||||
|
||||
# re-wrap in div tag.
|
||||
body = u'<div>\n' + body + u'\n</div>\n'
|
||||
body = u'<div>\n' + body + u'</div>\n'
|
||||
|
||||
# return body
|
||||
return tag_sanitizer(body)
|
||||
|
|
|
|||
Loading…
Reference in a new issue