mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
lint: function param
This commit is contained in:
parent
47cc03d05d
commit
8056d8c11e
@ -63,7 +63,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return tree.text + "\n\n" + serialize(tree.children);
|
||||
};
|
||||
|
||||
|
@ -55,7 +55,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return tree.text;
|
||||
};
|
||||
|
||||
|
@ -117,7 +117,7 @@ exports.parseIfClause = function(filterCondition) {
|
||||
return [listWidget];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var filterCondition = tree.attributes.filter.value;
|
||||
var ifClause = serialize(tree.children[0].children);
|
||||
var elseClause = tree.children[1].children;
|
||||
|
@ -37,7 +37,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return tree.entity === "–" ? "--" : "---";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return "''" + serialize(tree.children) + "''";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return "//" + serialize(tree.children) + "//";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return "~~" + serialize(tree.children) + "~~";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return ",," + serialize(tree.children) + ",,";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return "^^" + serialize(tree.children) + "^^";
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return "__" + serialize(tree.children) + "__";
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,7 @@ exports.parse = function() {
|
||||
return [{type: "entity", entity: this.match[0]}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
return tree.entity;
|
||||
};
|
||||
|
||||
|
@ -53,7 +53,7 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
if(tree.type === "text") {
|
||||
return "~" + tree.text;
|
||||
} else if(tree.type === "element" && tree.tag === "a") {
|
||||
|
@ -71,7 +71,7 @@ exports.parse = function() {
|
||||
return [node];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var serialized = "{{{" + tree.attributes.filter.value;
|
||||
// Tooltip text
|
||||
if(tree.attributes.tooltip) serialized += "|" + tree.attributes.tooltip.value;
|
||||
|
@ -70,9 +70,9 @@ exports.parse = function() {
|
||||
return [node];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var filteredtranscludeblock = require("$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js");
|
||||
var result = filteredtranscludeblock.serialize(tree, serialize);
|
||||
var result = filteredtranscludeblock.serialize(tree,serialize);
|
||||
return result.trimEnd();
|
||||
};
|
||||
|
||||
|
@ -93,7 +93,7 @@ exports.parse = function() {
|
||||
return parseTreeNodes;
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
// Type of definition: "function", "procedure", or "widget"
|
||||
var type = tree.isFunctionDefinition ? "function" : (tree.isProcedureDefinition ? "procedure" : "widget");
|
||||
// Name of the function, procedure, or widget
|
||||
|
@ -46,7 +46,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
// Get heading level from number after `h`
|
||||
var headingLevel = parseInt(tree.tag.substr(1),10);
|
||||
var classes = tree.attributes.class ? tree.attributes.class.value.split(" ").join(".") : "";
|
||||
|
@ -195,7 +195,7 @@ exports.isLegalTag = function(tag) {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var tag = tree.tag;
|
||||
var attributes = tree.orderedAttributes.map(function(attribute) {
|
||||
return $tw.utils.serializeAttribute(attribute);
|
||||
|
@ -130,7 +130,7 @@ exports.parseImage = function(source,pos) {
|
||||
return node;
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var width = tree.attributes.width ? " " + $tw.utils.serializeAttribute(tree.attributes.width) : "";
|
||||
var height = tree.attributes.height ? " " + $tw.utils.serializeAttribute(tree.attributes.height) : "";
|
||||
var padSpace = width || height ? " " : "";
|
||||
|
@ -160,7 +160,7 @@ exports.parse = function() {
|
||||
return [listStack[0]];
|
||||
};
|
||||
|
||||
exports.serialize = function (tree, serialize) {
|
||||
exports.serialize = function (tree,serialize) {
|
||||
// Helper function to find the marker for a given list container tag and item tag
|
||||
function findMarker(listTag, itemTag) {
|
||||
for(var key in listTypes) {
|
||||
|
@ -49,9 +49,9 @@ exports.parse = function() {
|
||||
/*
|
||||
Same as macrocallblock but without \n\n
|
||||
*/
|
||||
exports.serialize = function (tree, serialize) {
|
||||
exports.serialize = function (tree,serialize) {
|
||||
var macrocallblock = require("$:/core/modules/parsers/wikiparser/rules/macrocallblock.js");
|
||||
var result = macrocallblock.serialize(tree, serialize);
|
||||
var result = macrocallblock.serialize(tree,serialize);
|
||||
return result.trimEnd();
|
||||
};
|
||||
|
||||
|
@ -117,7 +117,7 @@ exports.parseLink = function(source,pos) {
|
||||
return node;
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var tooltip = tree.children[0].text;
|
||||
var url = tree.attributes.href.value;
|
||||
return "[ext[" + (tooltip !== url ? tooltip + "|" : "") + url + "]]";
|
||||
|
@ -67,7 +67,7 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var text = tree.children[0].text;
|
||||
var target = tree.attributes.to ? tree.attributes.to.value : tree.attributes.href.value;
|
||||
return "[[" + text + (text !== target ? "|" + target : "") + "]]";
|
||||
|
@ -73,7 +73,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function (tree, serialize) {
|
||||
exports.serialize = function (tree,serialize) {
|
||||
var result = [];
|
||||
if(tree.type === "element" && tree.tag === "blockquote") {
|
||||
// tree.attributes.class.value: "tc-quote"
|
||||
|
@ -68,7 +68,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function (tree, serialize) {
|
||||
exports.serialize = function (tree,serialize) {
|
||||
var result = [];
|
||||
if(tree.attributes.action && tree.attributes.rules) {
|
||||
// tree.attributes.action.value: "except"
|
||||
|
@ -73,7 +73,7 @@ exports.parse = function() {
|
||||
}]
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var lines = [];
|
||||
var classes = [];
|
||||
var styles = [];
|
||||
|
@ -55,7 +55,7 @@ exports.parse = function() {
|
||||
return [node];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var result = "@@";
|
||||
// Add styles if present
|
||||
if(tree.attributes && tree.attributes.style) {
|
||||
|
@ -50,7 +50,7 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
// Check if the link is suppressed
|
||||
var isSuppressed = tree.children[0].text.substr(0,1) === "~";
|
||||
var serialized = isSuppressed ? "~" : "";
|
||||
|
@ -188,7 +188,7 @@ exports.parse = function() {
|
||||
return [table];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var serialized = "";
|
||||
// Iterate over the table rows
|
||||
for(var i = 0; i < tree.children.length; i++) {
|
||||
|
@ -86,7 +86,7 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var result = "{{";
|
||||
function handleTransclude(transcludeNode) {
|
||||
// Handle field
|
||||
|
@ -84,9 +84,9 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var transcludeblock = require("$:/core/modules/parsers/wikiparser/rules/transcludeblock.js");
|
||||
var result = transcludeblock.serialize(tree, serialize);
|
||||
var result = transcludeblock.serialize(tree,serialize);
|
||||
return result.trimEnd();
|
||||
};
|
||||
|
||||
|
@ -98,7 +98,7 @@ exports.parse = function() {
|
||||
}
|
||||
};
|
||||
|
||||
exports.serialize = function (tree, serialize) {
|
||||
exports.serialize = function (tree,serialize) {
|
||||
if(tree.type === "void") {
|
||||
return "$$$" + tree.parseType + (tree.renderType ? " > " + tree.renderType : "") + "\n" + tree.text + "\n$$$\n\n";
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var isSuppressed = tree.children[0].text.substr(0,1) === $tw.config.textPrimitives.unWikiLink;
|
||||
|
||||
var serialized = isSuppressed ? $tw.config.textPrimitives.unWikiLink : "";
|
||||
|
@ -37,7 +37,7 @@ exports.parse = function() {
|
||||
return [{type: "text", text: linkText.substr(1)}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
var serialized = $tw.config.textPrimitives.unWikiLink;
|
||||
serialized += tree.text;
|
||||
return serialized;
|
||||
|
Loading…
Reference in New Issue
Block a user