Sanitize display strings for use in header.
authorplugd <plugd@thelambdalab.xyz>
Tue, 3 Aug 2021 08:09:39 +0000 (10:09 +0200)
committerplugd <plugd@thelambdalab.xyz>
Tue, 3 Aug 2021 08:09:39 +0000 (10:09 +0200)
elpher.el

index ccba716..b9c43f8 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -577,13 +577,14 @@ previously-visited pages,unless NO-HISTORY is non-nil."
   "If `elpher-use-header' is true, display current page info in window header."
   (if elpher-use-header
       (let* ((display-string (elpher-page-display-string elpher-current-page))
+             (sanitized-display-string (replace-regexp-in-string "%" "%%" display-string))
              (address (elpher-page-address elpher-current-page))
              (tls-string (if (and (not (elpher-address-about-p address))
                                   (member (elpher-address-protocol address)
                                           '("gophers" "gemini")))
                              " [TLS encryption]"
                            ""))
-             (header (concat display-string
+             (header (concat sanitized-display-string
                              (propertize tls-string 'face 'bold))))
         (setq header-line-format header))))