mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-11 11:52:07 +08:00
Fix replace_hr feature so it works with BS4 html.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user