]> git.eshelyaron.com Git - emacs.git/commitdiff
(json-encode-string): Strip properties to fix bug#43549
authorSam Steingold <sds@gnu.org>
Mon, 21 Sep 2020 15:50:29 +0000 (11:50 -0400)
committerSam Steingold <sds@gnu.org>
Mon, 21 Sep 2020 15:50:39 +0000 (11:50 -0400)
lisp/json.el

index 9002e8685374ef4080f8619c7dd2f888f82e0778..c2fc1574faa976c83222aae807abef0b7588f9f0 100644 (file)
@@ -432,14 +432,14 @@ Initialized lazily by `json-encode-string'.")
   ;; string length as our heuristic.  See also bug#20154.
   (if (and (< (length string) json--long-string-threshold)
            (not (string-match-p (rx json--escape) string)))
-      (concat "\"" string "\"")
+      (concat "\"" (substring-no-properties string) "\"")
     (with-current-buffer
         (or json--string-buffer
             (with-current-buffer (generate-new-buffer " *json-string*")
               ;; This seems to afford decent performance gains.
               (setq-local inhibit-modification-hooks t)
               (setq json--string-buffer (current-buffer))))
-      (insert ?\" string)
+      (insert ?\" (substring-no-properties string)) ; see bug#43549
       (goto-char (1+ (point-min)))
       (while (re-search-forward (rx json--escape) nil 'move)
         (let ((char (preceding-char)))