From f74b30f80eb7898b5cf6dec82706ce3d39a8ab06 Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Sat, 23 Dec 2023 15:31:23 +0100 Subject: [PATCH] Use rx for the regular expression --- kagi.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kagi.el b/kagi.el index a92985f..d53d77f 100644 --- a/kagi.el +++ b/kagi.el @@ -87,8 +87,9 @@ FastGPT with the following prompt: (with-temp-buffer (insert string) (goto-char (point-min)) - (while (re-search-forward "\\([^<]*\\)" nil t) - (replace-match (propertize (match-string 1) 'font-lock-face 'bold) t nil)) + (let ((bold-match (rx (seq "" (group (* (not "<"))) "")))) + (while (re-search-forward bold-match nil t) + (replace-match (propertize (match-string 1) 'font-lock-face 'bold) t nil))) (buffer-string))) (defun kagi--format-output (output)