mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-24 22:33:16 +00:00
parent
da298f037d
commit
892a1f560e
|
@ -72,8 +72,16 @@ exports["application/x-tiddler-html-div"] = function(text,fields) {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports["application/json"] = function(text,fields) {
|
exports["application/json"] = function(text,fields) {
|
||||||
var incoming = JSON.parse(text),
|
var incoming,
|
||||||
results = [];
|
results = [];
|
||||||
|
try {
|
||||||
|
incoming = JSON.parse(text);
|
||||||
|
} catch(e) {
|
||||||
|
incoming = [{
|
||||||
|
title: "JSON error: " + e,
|
||||||
|
text: ""
|
||||||
|
}]
|
||||||
|
}
|
||||||
if($tw.utils.isArray(incoming)) {
|
if($tw.utils.isArray(incoming)) {
|
||||||
for(var t=0; t<incoming.length; t++) {
|
for(var t=0; t<incoming.length; t++) {
|
||||||
var incomingFields = incoming[t],
|
var incomingFields = incoming[t],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user