diff --git a/HISTORY.md b/HISTORY.md index 708c530..b9e67be 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,11 @@ https://github.com/josdejong/jsoneditor +## not yet released, version 5.2.0 + +- Fixed #268: JSONEditor now trims text in fields and values. + + ## 2016-02-15, version 5.1.5 - Fixed #272: Checkbox for boolean values visible in view mode. diff --git a/src/js/Node.js b/src/js/Node.js index 707ab11..31362d1 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -3344,7 +3344,7 @@ Node.prototype._escapeHTML = function (text) { * @private */ Node.prototype._unescapeHTML = function (escapedText) { - var json = '"' + this._escapeJSON(escapedText) + '"'; + var json = '"' + this._escapeJSON(escapedText.trim()) + '"'; var htmlEscaped = util.parse(json); return htmlEscaped