Merge pull request #97 from corpulentcoffee/rename-field-fix

Use alternate pattern match during field changes
This commit is contained in:
Damien Elmes 2014-12-30 12:26:38 +10:00
commit b1ecdba42f

View file

@ -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 + '}}'