1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

lint: function param

This commit is contained in:
lin onetwo 2024-10-13 21:38:06 +08:00
parent 47cc03d05d
commit 8056d8c11e
33 changed files with 36 additions and 36 deletions

View File

@ -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);
};

View File

@ -55,7 +55,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree) {
exports.serialize = function(tree,serialize) {
return tree.text;
};

View File

@ -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;

View File

@ -37,7 +37,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree) {
exports.serialize = function(tree,serialize) {
return tree.entity === "–" ? "--" : "---";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return "''" + serialize(tree.children) + "''";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return "//" + serialize(tree.children) + "//";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return "~~" + serialize(tree.children) + "~~";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return ",," + serialize(tree.children) + ",,";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return "^^" + serialize(tree.children) + "^^";
};

View File

@ -47,7 +47,7 @@ exports.parse = function() {
}];
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
return "__" + serialize(tree.children) + "__";
};

View File

@ -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;
};

View File

@ -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") {

View File

@ -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;

View File

@ -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();
};

View File

@ -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

View File

@ -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(".") : "";

View File

@ -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);

View File

@ -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 ? " " : "";

View File

@ -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) {

View File

@ -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();
};

View File

@ -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 + "]]";

View File

@ -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 : "") + "]]";

View File

@ -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"

View File

@ -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"

View File

@ -73,7 +73,7 @@ exports.parse = function() {
}]
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
var lines = [];
var classes = [];
var styles = [];

View File

@ -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) {

View File

@ -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 ? "~" : "";

View File

@ -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++) {

View File

@ -86,7 +86,7 @@ exports.parse = function() {
}
};
exports.serialize = function(tree, serialize) {
exports.serialize = function(tree,serialize) {
var result = "{{";
function handleTransclude(transcludeNode) {
// Handle field

View File

@ -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();
};

View File

@ -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";
}

View File

@ -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 : "";

View File

@ -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;