mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-06 03:20:24 +02:00
Fix replace_hr feature so it works with BS4 html.
This commit is contained in:
parent
897976b4bd
commit
6d1798c29e
2 changed files with 4 additions and 2 deletions
|
|
@ -624,7 +624,7 @@ class BaseSiteAdapter(Configurable):
|
|||
if self.getConfig('replace_hr'):
|
||||
# replacing a self-closing tag with a container tag in the
|
||||
# soup is more difficult than it first appears. So cheat.
|
||||
retval = retval.replace("<hr />","<div class='center'>* * *</div>")
|
||||
retval = re.sub("<hr[^>]*>","<div class='center'>* * *</div>",retval)
|
||||
|
||||
return retval
|
||||
|
||||
|
|
|
|||
|
|
@ -279,7 +279,9 @@ div { margin: 0pt; padding: 0pt; }
|
|||
retval = retval + END.substitute(self.story.getAllMetadata())
|
||||
|
||||
if self.getConfig('replace_hr'):
|
||||
retval = retval.replace("<hr />","<div class='center'>* * *</div>")
|
||||
# replacing a self-closing tag with a container tag in the
|
||||
# soup is more difficult than it first appears. So cheat.
|
||||
retval = re.sub("<hr[^>]*>","<div class='center'>* * *</div>",retval)
|
||||
|
||||
return retval
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue