summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-28 00:17:06 +0200
committerThanos Apollo <[email protected]>2023-12-28 00:17:06 +0200
commit5e9db3954a1c9714841279eb5f309821cf6235cc (patch)
treee8730c32ac7e07421b93f15fc4a454530dd473b6
parent2d8cbf4b67c73ee099fc5490a91b26b99eb176ea (diff)
cloze: Update regex for cloze cards
This fixes previous issues, now we can use anki-like clozes & {c1:cloze} format without any issue
-rw-r--r--gnosis.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnosis.el b/gnosis.el
index 9a61325..f12b551 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -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)