EPUB Output: Be a little more conservative when removing <form> tags. Only remove them if they have actual forms inside. (See 1000384)

This commit is contained in:
Kovid Goyal 2012-05-17 09:32:11 +05:30
parent eed226a54a
commit dec98d404e

View File

@ -393,8 +393,14 @@ class EPUBOutput(OutputFormatPlugin):
for tag in XPath('//h:body/descendant::h:script')(root):
tag.getparent().remove(tag)
formchildren = XPath('./h:input|./h:button|./h:textarea|'
'./h:label|./h:fieldset|./h:legend')
for tag in XPath('//h:form')(root):
if formchildren(tag):
tag.getparent().remove(tag)
else:
# Not a real form
tag.tag = XHTML('div')
for tag in XPath('//h:center')(root):
tag.tag = XHTML('div')