From 5e9db3954a1c9714841279eb5f309821cf6235cc Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 28 Dec 2023 00:17:06 +0200 Subject: cloze: Update regex for cloze cards This fixes previous issues, now we can use anki-like clozes & {c1:cloze} format without any issue --- gnosis.el | 4 ++-- 1 file 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) -- cgit v1.2.3