mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
Merge pull request #97 from corpulentcoffee/rename-field-fix
Use alternate pattern match during field changes
This commit is contained in:
commit
b1ecdba42f
1 changed files with 1 additions and 1 deletions
|
@ -304,7 +304,7 @@ and notes.mid = ? and cards.ord = ?""", m['id'], ord)
|
|||
|
||||
def renameField(self, m, field, newName):
|
||||
self.col.modSchema(check=True)
|
||||
pat = r'{{(.*)([:#^/]|[^:#/^}][^:}]*?:|)%s}}'
|
||||
pat = r'{{([^{}]*)([:#^/]|[^:#/^}][^:}]*?:|)%s}}'
|
||||
def wrap(txt):
|
||||
def repl(match):
|
||||
return '{{' + match.group(1) + match.group(2) + txt + '}}'
|
||||
|
|
Loading…
Reference in a new issue