branch: elpa/htmlize
commit 97b6b8dd5daebf4bd8589c8d8bb6dd393d77b9b1
Author: Hrvoje Niksic <[email protected]>
Commit: Hrvoje Niksic <[email protected]>

    Escape link text.
---
 htmlize.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/htmlize.el b/htmlize.el
index 7aebd03..73c5940 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -471,10 +471,11 @@ next-single-char-property-change")))
 (defun htmlize-format-link (linkprops text)
   (let ((uri (if (stringp linkprops)
                  linkprops
-               (plist-get linkprops :uri))))
+               (plist-get linkprops :uri)))
+        (escaped-text (htmlize-protect-string text)))
     (if uri
-        (format "<a href=\"%s\">%s</a>" (htmlize-attr-escape uri) text)
-      (htmlize-protect-string text))))
+        (format "<a href=\"%s\">%s</a>" (htmlize-attr-escape uri) escaped-text)
+      escaped-text)))
 
 (defun htmlize-escape-or-link (string)
   ;; Escape STRING and/or add hyperlinks.

Reply via email to