Use rx for the regular expression
This commit is contained in:
parent
cabfd25d2e
commit
f74b30f80e
1 changed files with 3 additions and 2 deletions
5
kagi.el
5
kagi.el
|
@ -87,8 +87,9 @@ FastGPT with the following prompt:
|
|||
(with-temp-buffer
|
||||
(insert string)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "<b>\\([^<]*\\)</b>" nil t)
|
||||
(replace-match (propertize (match-string 1) 'font-lock-face 'bold) t nil))
|
||||
(let ((bold-match (rx (seq "<b>" (group (* (not "<"))) "</b>"))))
|
||||
(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)
|
||||
|
|
Loading…
Reference in a new issue