diff --git a/cleanerupper/plugin.py b/cleanerupper/plugin.py index 2be0373..692c065 100644 --- a/cleanerupper/plugin.py +++ b/cleanerupper/plugin.py @@ -64,6 +64,16 @@ def bring_punctuation_into_italics(html): html = re.sub('\\{punct}'.format(**locals()), '{punct}'.format(**locals()), html) return html +@html_cleaner +def remove_header_br(html): + html = re.sub(r'

([^\n]+?)\s*
\s*([^\n]+?)

', r'

\1 \2

', html) + html = re.sub(r'

([^\n]+?)\s*
\s*([^\n]+?)

', r'

\1 \2

', html) + html = re.sub(r'

([^\n]+?)\s*
\s*([^\n]+?)

', r'

\1 \2

', html) + html = re.sub(r'

([^\n]+?)\s*
\s*([^\n]+?)

', r'

\1 \2

', html) + html = re.sub(r'
([^\n]+?)\s*
\s*([^\n]+?)
', r'
\1 \2
', html) + html = re.sub(r'
([^\n]+?)\s*
\s*([^\n]+?)
', r'
\1 \2
', html) + return html + @html_cleaner def remove_misc_strings(html): html = html.replace('epub:type="pagebreak"', '')