mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion pipeline: Run conversion removal regexps first to make them act on text closer to that shown in the regex builder
This commit is contained in:
parent
442df69b91
commit
53f02e555e
@ -252,7 +252,7 @@ class HTMLPreProcessor(object):
|
|||||||
end_rules = []
|
end_rules = []
|
||||||
if getattr(self.extra_opts, 'remove_header', None):
|
if getattr(self.extra_opts, 'remove_header', None):
|
||||||
try:
|
try:
|
||||||
end_rules.append(
|
rules.insert(0,
|
||||||
(re.compile(self.extra_opts.header_regex), lambda match : '')
|
(re.compile(self.extra_opts.header_regex), lambda match : '')
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
@ -262,7 +262,7 @@ class HTMLPreProcessor(object):
|
|||||||
|
|
||||||
if getattr(self.extra_opts, 'remove_footer', None):
|
if getattr(self.extra_opts, 'remove_footer', None):
|
||||||
try:
|
try:
|
||||||
end_rules.append(
|
rules.insert(0
|
||||||
(re.compile(self.extra_opts.footer_regex), lambda match : '')
|
(re.compile(self.extra_opts.footer_regex), lambda match : '')
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user