Fix for re-souping including extra html and head tags.

This commit is contained in:
Jim Miller 2015-01-03 12:15:35 -06:00
parent 579f2f5aa2
commit 3118639755

View file

@ -551,9 +551,9 @@ class BaseSiteAdapter(Configurable):
retval = re.sub(r"(?!<(div|p)>)\s*(?P<imgtag><img[^>]+>)\s*(?!</(div|p)>)",
"<div>\g<imgtag></div>",retval)
# Don't want body tags in chapter html--writers add them.
# Don't want html, head or body tags in chapter html--writers add them.
# This is primarily for epub updates.
retval = re.sub(r"</?body[^>]*>\r?\n?","",retval)
retval = re.sub(r"</?(html|head|body)[^>]*>\r?\n?","",retval)
if self.getConfig("replace_br_with_p"):
# Apply heuristic processing to replace <br> paragraph