Add additional fields support for evernote plugin

Relates to Issue #2268

Add the additional field defined in the XML as properties to the result.
This also appears to capture the 'author' field.
This commit is contained in:
Devin Weaver 2016-02-04 18:31:24 -05:00
parent 8904a6dba6
commit 1d35087f29
1 changed files with 5 additions and 1 deletions

View File

@ -34,11 +34,15 @@ exports["application/enex+xml"] = function(text,fields) {
// Get all the "note" nodes
var noteNodes = doc.querySelectorAll("note");
$tw.utils.each(noteNodes,function(noteNode) {
results.push({
var result = {
title: noteNode.querySelector("title").textContent,
type: "text/html",
text: noteNode.querySelector("content").textContent
};
$tw.utils.each(noteNodes.querySelector("note-attributes").childNodes,function(attrNode) {
result[attrNode.tagName] = attrNode.textContent;
});
results.push(result);
});
// Return the output tiddlers
return results;