Sfoglia il codice sorgente

* org-html.el: Bugfix: prevent infinite matching of the `&' character.

* org-html.el (org-html-protect): Bugfix: prevent infinite
matching of the `&' character.

This bug was spotted by Rehan Iftikhar.
Bastien Guerry 14 anni fa
parent
commit
f6752c805e
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      lisp/org-html.el

+ 3 - 1
lisp/org-html.el

@@ -2184,7 +2184,9 @@ Possible conversions are set in `org-export-html-protect-char-alist'."
   (let ((cl org-export-html-protect-char-alist) c)
     (while (setq c (pop cl))
       (let ((start 0))
-	(while (string-match (car c) s start)
+	(while (and (string-match (car c) s start)
+		    ;; prevent infinite matching of &
+		    (not (string-match "&" s start)))
 	  (setq s (replace-match (cdr c) t t s)
 		start (match-beginning 0)))))
     s))