This commit is contained in:
parent
547438664f
commit
dc40abf143
|
@ -6,6 +6,7 @@ https://github.com/josdejong/jsoneditor
|
|||
## not yet released, version 4.2.2
|
||||
|
||||
- Replaced the PNG icon images with SVG. Thanks @1j01.
|
||||
- Fixed #230, #227, and #93: html and unicode characters not escaped.
|
||||
- Fixed #149: Memory leak when switching mode from/to `code` mode, web worker
|
||||
of Ace editor wasn't cleaned up.
|
||||
- Fixed #234: Remove dependency on a fork of the `jsonlint` project on github.
|
||||
|
|
|
@ -2858,6 +2858,7 @@ Node.prototype._stringCast = function(str) {
|
|||
*/
|
||||
Node.prototype._escapeHTML = function (text) {
|
||||
var htmlEscaped = String(text)
|
||||
.replace(/&/g, '&') // must be replaced first!
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/ /g, ' ') // replace double space with an nbsp and space
|
||||
|
@ -2880,7 +2881,8 @@ Node.prototype._unescapeHTML = function (escapedText) {
|
|||
return htmlEscaped
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/ |\u00A0/g, ' ');
|
||||
.replace(/ |\u00A0/g, ' ')
|
||||
.replace(/&/g, '&'); // must be replaced last
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test JSONEditor</title>
|
||||
<!--<meta http-equiv="Content-Type" content="text/html;charset=utf-8">-->
|
||||
|
||||
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
|
||||
|
@ -50,6 +51,8 @@
|
|||
json = {
|
||||
"array": [1, 2, 3],
|
||||
"boolean": true,
|
||||
"htmlcode": '"',
|
||||
"unicode": '®',
|
||||
"null": null,
|
||||
"number": 123,
|
||||
"object": {"a": "b", "c": "d"},
|
||||
|
|
Loading…
Reference in New Issue