mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
On second thoughts prevent all backslash escape sequences from being interpreted in normal mode replace strings
This commit is contained in:
parent
41a40e73be
commit
55a06967f7
@ -1219,7 +1219,8 @@ def get_search_function(state):
|
||||
ans = state['replace']
|
||||
is_regex = state['mode'] != 'normal'
|
||||
if not is_regex:
|
||||
ans = regex.sub(r'\\([0-9g])', r'\\\\\1', ans)
|
||||
# We dont want backslash escape sequences interpreted in normal mode
|
||||
return lambda m: ans
|
||||
if state['mode'] == 'function':
|
||||
try:
|
||||
return replace_functions()[ans]
|
||||
|
Loading…
x
Reference in New Issue
Block a user