diff options
author | Thanos Apollo <[email protected]> | 2023-12-28 00:17:06 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-28 00:17:06 +0200 |
commit | 5e9db3954a1c9714841279eb5f309821cf6235cc (patch) | |
tree | e8730c32ac7e07421b93f15fc4a454530dd473b6 /gnosis.el | |
parent | 2d8cbf4b67c73ee099fc5490a91b26b99eb176ea (diff) |
cloze: Update regex for cloze cards
This fixes previous issues, now we can use anki-like clozes &
{c1:cloze} format without any issue
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -303,8 +303,8 @@ choice in the `CHOICES' list. Each note must correspond to one `DECK'. "Replace cx-tags in STRING. Works both with {} and {{}} to make easier to import anki notes." - (let* ((regex "{\\{1,2\\}c[0-9]+::\\([^}]*\\)}\\{1,2\\}") - (result (replace-regexp-in-string regex "\\1" string))) + (let* ((regex "{\\{1,2\\}c\\([0-9]+\\)::?\\(.*?\\)}\\{1,2\\}") + (result (replace-regexp-in-string regex "\\2" string))) result)) (defun gnosis-cloze-replace-words (string words new) |