mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
Merge pull request #11 from ospalh/field-delete
match the whole {{xx:yy}} field so we can delete it
This commit is contained in:
commit
31b93061d4
1 changed files with 2 additions and 2 deletions
|
@ -264,10 +264,10 @@ select id from cards where nid in (select id from notes where mid = ?)""",
|
|||
|
||||
def renameField(self, m, field, newName):
|
||||
self.col.modSchema()
|
||||
pat = "({{|[:#^/])%s(}})"
|
||||
pat = r'{{([:#^/]|[^:#/^}][^:}]*?:|)%s}}'
|
||||
def wrap(txt):
|
||||
def repl(match):
|
||||
return match.group(1) + txt + match.group(2)
|
||||
return '{{' + match.group(1) + txt + '}}'
|
||||
return repl
|
||||
for t in m['tmpls']:
|
||||
for fmt in ('qfmt', 'afmt'):
|
||||
|
|
Loading…
Reference in a new issue