mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fixed the order Search/Replace expressions are applied.
S/R expressions where inserted at the start of the rules list in order so they where applied in reverse. Used a reverse iterator over the list of search/replace expressions so they are applied in the correct order.
This commit is contained in:
parent
82ca10aca3
commit
9c5faee800
@ -538,7 +538,7 @@ class HTMLPreProcessor(object):
|
||||
search_replace = getattr(self.extra_opts, 'search_replace', None)
|
||||
if search_replace:
|
||||
search_replace = json.loads(search_replace)
|
||||
for search_pattern, replace_txt in search_replace:
|
||||
for search_pattern, replace_txt in reversed(search_replace):
|
||||
do_search_replace(search_pattern, replace_txt)
|
||||
|
||||
end_rules = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user