diff options
author | Thanos Apollo <[email protected]> | 2023-12-27 10:03:41 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-27 10:03:41 +0200 |
commit | e2391c6eedd895de2f43575db596d45d4a7779bd (patch) | |
tree | b018ff73080c5645a008076b929c973230281963 /gnosis.el | |
parent | 43ebca1233c040a73dfdc5d048eb71c912883e10 (diff) |
Add gnosis-cloze-remove-tags
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -248,6 +248,14 @@ choice in the `CHOICES' list. Each note must correspond to one `DECK'. (history-add-new-input nil)) ;; Disable history (completing-read "Answer: " choices))) +(defun gnosis-cloze-remove-tags (string) + "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))) + result)) + (defun gnosis-cloze-replace-words (string words new) "In STRING replace WORDS with NEW." (cl-assert (listp words)) |