1
0
Fork 0

Perform non-greedy match between the start and end marker

This commit is contained in:
Bram Schoenmakers 2023-12-28 21:44:33 +01:00
parent e8950dfd56
commit 575ac76fa3
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

View file

@ -153,7 +153,7 @@ FastGPT with the following prompt:
(dolist (entry kagi--markup-to-face)
(cl-destructuring-bind (start end face) entry
(goto-char (point-min))
(let ((regexp (rx (seq (literal start) (group (* any)) (literal end)))))
(let ((regexp (rx (seq (literal start) (group (*? any)) (literal end)))))
(while (re-search-forward regexp nil t)
(let ((escaped-replacement (string-replace "\\" "\\\\" (match-string 1))))
(replace-match (propertize escaped-replacement 'font-lock-face face) t nil)