diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index 385674f5b1a..bd4ced78efd 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -453,7 +453,12 @@ Any \"<<\" strings encountered are converted to \"<\". Return value is \(begin end name positive-p), or nil if none was found." (while (and (search-forward "<" nil 1) (progn (goto-char (match-beginning 0)) - (not (looking-at enriched-annotation-regexp)))) + ;; Make sure we are not inside a string, where any + ;; matches for 'enriched-annotation-regexp' are + ;; false positives. This happens, for example, in + ;; display properties that specify SVG images. + (or (nth 3 (syntax-ppss)) + (not (looking-at enriched-annotation-regexp))))) (forward-char 1) (if (eq ?< (char-after (point))) (delete-char 1)