Skip to content

Commit

Permalink
Fix issue #142.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Jan 17, 2017
1 parent 758a9c3 commit 19917cb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
JSONView 1.2.3
---
* Fixed a case where JSON would fail to parse if a string containing a number was preceded by a quote that was preceded by an escaped slash.

JSONView 1.2.2
---
* Fixed a case where JSON would fail to parse if a string containing a number also contained escaped quotes.
Expand Down Expand Up @@ -97,17 +101,14 @@ JSONView 0.2
---

* .json files can be opened in JSONView from the local machine.
* Added Bulgarian, German, Hungarian, and (partial) Turkish translations. Thanks to
Стоян Димитров, Archaeopteryx, Team erweiterungen.de, MIKES KASZMÁN István and Ersen Yolda from BabelZilla.org.
* Added Bulgarian, German, Hungarian, and (partial) Turkish translations. Thanks to Стоян Димитров, Archaeopteryx, Team erweiterungen.de, MIKES KASZMÁN István and Ersen Yolda from BabelZilla.org.
* Compatible with FF 3.5.*

JSONView 0.1
---

* String values which contain only a URL are displayed as a clickable link. Props to stig.murberg for the patch.
* Added Catalan, Spanish, Japanese, Portugese (Brazil), Russian, and Simplified Chinese translations. Thanks to
Fani Kozolchyk, and Xavi Ivars - Softcatalà, hoolooday, drry, Marcelo Ghelman (ghelman.net), Пирятинский Виталий,
and urko from BabelZilla.org.
* Added Catalan, Spanish, Japanese, Portugese (Brazil), Russian, and Simplified Chinese translations. Thanks to Fani Kozolchyk, and Xavi Ivars - Softcatalà, hoolooday, drry, Marcelo Ghelman (ghelman.net), Пирятинский Виталий, and urko from BabelZilla.org.

JSONView 0.1b3:
---
Expand Down
2 changes: 1 addition & 1 deletion lib/jsonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var JSONView = Class({
if (str[i] === '"') {
var escaped =
(i > 0 && str[i - 1] === '\\') &&
(i > 1 || str[i - 2] !== '\\');
(i > 1 && str[i - 2] !== '\\');
if (!escaped) {
inQuotes = !inQuotes;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "[email protected]",
"version": "1.2.2",
"version": "1.2.3",
"name": "jsonview",
"title": "JSONView",
"description": "View JSON documents in the browser.",
Expand Down
1 change: 1 addition & 0 deletions tests/issue142.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":0,"message":"OK","result":[{"fund_id":2,"fund_mnemo":"BAIKAL","fund_name":"\u041e\u0410\u041e \u0410\u041a \"\u0411\u0430\u0439\u043a\u0430\u043b\u0411\u0430\u043d\u043a\" ","allow":true,"answer":"\u041d\u0435\u0442 API \u0444\u043e\u043d\u0434\u0430"},{"fund_id":4,"fund_mnemo":null,"fund_name":"\u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u043e\u043d\u0434","allow":true,"answer":"\u041d\u0435\u0442 API \u0444\u043e\u043d\u0434\u0430"}],"cached":false}
4 changes: 4 additions & 0 deletions tests/issue142b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"precondition": "text that ends in an escaped backslash \\",
"errorline": "After the number, the parser complains: 3 here is the error"
}
3 changes: 3 additions & 0 deletions tests/issue142c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"key":"\"value\u201d"
}
1 change: 1 addition & 0 deletions tests/issue50.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"PriorityPointValue":600,"GraphicClickThruUrl":"http://ad.doubleclick.net/clk;279758588;106767756;n","AdditionalUrls":[]}

0 comments on commit 19917cb

Please sign in to comment.