1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Merge pull request #2272 from sukima/feature/issue-2268-evernote-importer

Add some features to the EverNote import plugin
This commit is contained in:
Jeremy Ruston 2016-02-05 18:56:38 +00:00
commit d1d41fb9fc

View File

@ -34,10 +34,24 @@ exports["application/enex+xml"] = function(text,fields) {
// Get all the "note" nodes // Get all the "note" nodes
var noteNodes = doc.querySelectorAll("note"); var noteNodes = doc.querySelectorAll("note");
$tw.utils.each(noteNodes,function(noteNode) { $tw.utils.each(noteNodes,function(noteNode) {
results.push({ var result = {
title: noteNode.querySelector("title").textContent, title: noteNode.querySelector("title").textContent,
type: "text/html", type: "text/html",
tags: Array.prototype.slice.call(noteNode.querySelectorAll("tag")).map(function(tag) { return tag.textContent; }).join(","),
text: noteNode.querySelector("content").textContent text: noteNode.querySelector("content").textContent
};
$tw.utils.each(noteNodes.querySelector("note-attributes").childNodes,function(attrNode) {
result[attrNode.tagName] = attrNode.textContent;
});
results.push(result);
$tw.utils.each(noteNode.querySelectorAll("resources"),function(resourceNode) {
results.push({
title: resourceNode.querySelector("resource-attributes>file-name").textContent,
type: resourceNode.querySelector("mime").textContent,
width: resourceNode.querySelector("width").textContent,
height: resourceNode.querySelector("height").textContent,
text: resourceNode.querySelector("data").textContent
});
}); });
}); });
// Return the output tiddlers // Return the output tiddlers