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:
Kovid Goyal 2010-05-28 16:26:22 -06:00
parent 442df69b91
commit 53f02e555e

View File

@ -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: