summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-02 18:10:04 +0300
committerThanos Apollo <[email protected]>2024-07-02 18:10:04 +0300
commit6df4a3d342bee27ef6891dc4930dd3ff17c52c31 (patch)
tree911dee1e4d614ce18171c62844bd2b3dde6109e9
parent278bc63fc2a5793d1178bb727d286c5f3dce3996 (diff)
gnosis-apply-syntax-overlay: Update regex & add underline
-rw-r--r--gnosis.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/gnosis.el b/gnosis.el
index cf25631..10c54d4 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -374,10 +374,11 @@ This will not be applied to sentences that start with double space."
(defun gnosis-apply-syntax-overlay ()
"Apply custom font overlays for syntax highlighting, and remove delimiters."
- (let ((syntax-highlights '(("\\*\\([^*[:space:]][^*]*[^*[:space:]]\\)\\*" . bold)
- ("/\\([^/[:space:]][^/]*[^/[:space:]]\\)/" . italic)
- ("=\\([^=[:space:]][^=]*[^=[:space:]]\\)=" . font-lock-constant-face)
- ("~\\([^~[:space:]][^~]*[^~[:space:]]\\)~" . font-lock-keyword-face))))
+ (let ((syntax-highlights '(("\\*\\([^*[:space:]][^*\n]*[^*[:space:]]\\)\\*" . bold)
+ ("/\\([^/[:space:]][^/\n]*[^/[:space:]]\\)/" . italic)
+ ("=\\([^=[:space:]][^=\n]*[^=[:space:]]\\)=" . font-lock-constant-face)
+ ("~\\([^~[:space:]][^~\n]*[^~[:space:]]\\)~" . font-lock-keyword-face)
+ ("_\\([^_[:space:]][^_\n]*[^_[:space:]]\\)_" . underline))))
(save-excursion
(cl-loop for (regex . face) in syntax-highlights
do (progn
@@ -442,7 +443,8 @@ If FILL-PARAGRAPH-P, insert using `fill-paragraph'"
(let ((cloze-sentence
(gnosis-cloze-replace-words sentence clozes (propertize gnosis-cloze-string 'face 'gnosis-face-cloze))))
(insert "\n" (gnosis-center-string cloze-sentence))
- (gnosis-insert-separator)))
+ (gnosis-insert-separator)
+ (gnosis-apply-syntax-overlay)))
(defun gnosis-display-basic-answer (answer success user-input)
"Display ANSWER.