mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
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:
parent
eed226a54a
commit
dec98d404e
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user