From 528b909fe1c6076257a88ed8118ab050836a30f1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 5 Feb 2015 12:56:23 +0100 Subject: [PATCH] ox-html: Properly escape ampersands in links * lisp/ox-html.el (org-html-link): Properly escape ampersands in links. (org-html-encode-plain-text): Small refactoring. Reported-by: Karl Voit --- lisp/ox-html.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 2817d6c61..3733319cb 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2734,8 +2734,9 @@ INFO is a plist holding contextual information. See (path (cond ((member type '("http" "https" "ftp" "mailto")) - (org-link-escape-browser - (org-link-unescape (concat type ":" raw-path)))) + (org-html-encode-plain-text + (org-link-escape-browser + (org-link-unescape (concat type ":" raw-path))))) ((string= type "file") ;; Treat links to ".org" files as ".html", if needed. (setq raw-path @@ -2981,11 +2982,8 @@ contextual information." (defun org-html-encode-plain-text (text) "Convert plain text characters from TEXT to HTML equivalent. Possible conversions are set in `org-html-protect-char-alist'." - (mapc - (lambda (pair) - (setq text (replace-regexp-in-string (car pair) (cdr pair) text t t))) - org-html-protect-char-alist) - text) + (dolist (pair org-html-protect-char-alist text) + (setq text (replace-regexp-in-string (car pair) (cdr pair) text t t)))) (defun org-html-plain-text (text info) "Transcode a TEXT string from Org to HTML. -- 2.11.4.GIT