diff options
| -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'.") | |||
| 432 | ;; string length as our heuristic. See also bug#20154. | 432 | ;; string length as our heuristic. See also bug#20154. |
| 433 | (if (and (< (length string) json--long-string-threshold) | 433 | (if (and (< (length string) json--long-string-threshold) |
| 434 | (not (string-match-p (rx json--escape) string))) | 434 | (not (string-match-p (rx json--escape) string))) |
| 435 | (concat "\"" string "\"") | 435 | (concat "\"" (substring-no-properties string) "\"") |
| 436 | (with-current-buffer | 436 | (with-current-buffer |
| 437 | (or json--string-buffer | 437 | (or json--string-buffer |
| 438 | (with-current-buffer (generate-new-buffer " *json-string*") | 438 | (with-current-buffer (generate-new-buffer " *json-string*") |
| 439 | ;; This seems to afford decent performance gains. | 439 | ;; This seems to afford decent performance gains. |
| 440 | (setq-local inhibit-modification-hooks t) | 440 | (setq-local inhibit-modification-hooks t) |
| 441 | (setq json--string-buffer (current-buffer)))) | 441 | (setq json--string-buffer (current-buffer)))) |
| 442 | (insert ?\" string) | 442 | (insert ?\" (substring-no-properties string)) ; see bug#43549 |
| 443 | (goto-char (1+ (point-min))) | 443 | (goto-char (1+ (point-min))) |
| 444 | (while (re-search-forward (rx json--escape) nil 'move) | 444 | (while (re-search-forward (rx json--escape) nil 'move) |
| 445 | (let ((char (preceding-char))) | 445 | (let ((char (preceding-char))) |