From 5b925ed868b31bcae4dcc95cd519a701b871d11a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 5 Feb 2016 19:48:37 +0000 Subject: [PATCH] Further tweaks to #2272 @sukima the main issue with the previous code was that it incorrectly used comma to delimit tags. We actually use spaces, and double square brackets to delimit tags containing spaces. Better is to leave the tags field as an array; the core will serialise it correctly as required. I also made some minor consistency tweaks. --- plugins/tiddlywiki/evernote/modules/enex-deserializer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/tiddlywiki/evernote/modules/enex-deserializer.js b/plugins/tiddlywiki/evernote/modules/enex-deserializer.js index 6e250fb16..f01156541 100644 --- a/plugins/tiddlywiki/evernote/modules/enex-deserializer.js +++ b/plugins/tiddlywiki/evernote/modules/enex-deserializer.js @@ -37,10 +37,13 @@ exports["application/enex+xml"] = function(text,fields) { var result = { title: noteNode.querySelector("title").textContent, type: "text/html", - tags: Array.prototype.slice.call(noteNode.querySelectorAll("tag")).map(function(tag) { return tag.textContent; }).join(","), + tags: [], text: noteNode.querySelector("content").textContent }; - $tw.utils.each(noteNode.querySelector("note-attributes").childNodes,function(attrNode) { + $tw.utils.each(noteNode.querySelectorAll("tag"),function(tagNode) { + result.tags.push(tagNode.textContent); + }); + $tw.utils.each(noteNode.querySelectorAll("note-attributes"),function(attrNode) { result[attrNode.tagName] = attrNode.textContent; }); results.push(result);