diff options
author | Sam Steingold <sds@gnu.org> | 2020-09-21 11:50:29 -0400 |
---|---|---|
committer | Sam Steingold <sds@gnu.org> | 2020-09-21 11:50:39 -0400 |
commit | fb8c319825a15f0892b84c1985961fd865e54e13 (patch) | |
tree | f6414733ec458d0a792d2269dec5281f9d53a2e0 | |
parent | fa560bea191033e8af6bf3dc49cb6f6d94611535 (diff) | |
download | emacs-fb8c319825a15f0892b84c1985961fd865e54e13.tar.gz emacs-fb8c319825a15f0892b84c1985961fd865e54e13.tar.bz2 emacs-fb8c319825a15f0892b84c1985961fd865e54e13.zip |
(json-encode-string): Strip properties to fix bug#43549
-rw-r--r-- | lisp/json.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/json.el b/lisp/json.el index 9002e868537..c2fc1574faa 100644 --- a/lisp/json.el +++ b/lisp/json.el @@ -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))) |