mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 17:10:29 +00:00
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.
This commit is contained in:
parent
6aac2b00c9
commit
5b925ed868
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user