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

lint: useless comments

This commit is contained in:
lin onetwo 2024-08-09 22:45:14 +08:00
parent 856cb42039
commit 3cf93d08e5
16 changed files with 2 additions and 41 deletions

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'strong', children: [{ type: 'text', text: 'bold' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = "''";
// Serialize the children of the bold element
serialized += serialize(tree.children);

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'em', children: [{ type: 'text', text: 'italic' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = "//";
// Serialize the children of the italic element
serialized += serialize(tree.children);

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'strike', children: [{ type: 'text', text: 'strikethrough' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = "~~";
// Serialize the children of the strikethrough element
serialized += serialize(tree.children);

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'sub', children: [{ type: 'text', text: 'subscript' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = ",,";
// Serialize the children of the subscript element
serialized += serialize(tree.children);

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'sup', children: [{ type: 'text', text: 'superscript' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = "^^";
// Serialize the children of the superscript element
serialized += serialize(tree.children);

View File

@ -48,9 +48,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'element', tag: 'u', children: [{ type: 'text', text: 'underscore' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter
var serialized = "__";
// Serialize the children of the underscore element
serialized += serialize(tree.children);

View File

@ -74,7 +74,6 @@ exports.parse = function() {
};
exports.serialize = function (tree, serialize) {
// tree: { type: "element", tag: "blockquote", attributes: { class: { type: "string", value: "tc-quote" } }, children: [{ type: "element", tag: "cite", children: [{ type: "text", text: "tc-quote" }] }, { type: "element", tag: "p", children: [{ type: "text", text: "Quote text\n" }] }] }
var result = [];
if(tree.type === "element" && tree.tag === "blockquote") {
// tree.attributes.class.value: "tc-quote"

View File

@ -69,7 +69,6 @@ exports.parse = function() {
};
exports.serialize = function (tree, serialize) {
// tree: { type: "void", attributes: { action: { type: "string", value: "except" }, rules: { type: "string", value: "ruleone ruletwo rulethree" } }, children: [{ type: "void", attributes: { action: { type: "string", value: "only" }, rules: { type: "string", value: "ruleone ruletwo rulethree" } }, children: [] }] }
var result = [];
if(tree.attributes.action && tree.attributes.rules) {
// tree.attributes.action.value: "except"

View File

@ -74,7 +74,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// serialize: function that serializes an array of nodes or a single node to a string
var lines = [];
var classes = [];
var styles = [];

View File

@ -56,8 +56,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: {type: "element", tag: "span", children: [...], attributes: {class: {name: "class", type: "string", value: " myClass "}, style: {name: "style", type: "string", value: "background-color:red;"}}, orderedAttributes: [...], start: 0, end: 43, rule: "styleinline"}
// serialize: function that accepts an array of nodes or a single node and returns a string
var result = "@@";
// Add styles if present
if(tree.attributes && tree.attributes.style) {

View File

@ -51,11 +51,9 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'link', attributes: { to: { type: 'string', value: '$:TiddlerTitle' } }, children: [{ type: 'text', text: '$:TiddlerTitle' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Check if the link is suppressed
var isSuppressed = tree.children[0].text.substr(0,1) === "~";
// Initialize the serialized string
var serialized = isSuppressed ? "~" : "";
// Append the link value
serialized += tree.attributes.to.value;

View File

@ -87,9 +87,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'transclude', attributes: { $tiddler: { name: '$tiddler', type: 'string', value: 'MyTiddler' }, $field: { name: '$field', type: 'string', value: 'text' } }, isBlock: true }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string
var serialized = "{{";
// Check for tiddler attribute
if(tree.attributes.$tiddler) {

View File

@ -85,9 +85,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'transclude', attributes: { $tiddler: { name: '$tiddler', type: 'string', value: 'MyTiddler' }, $field: { name: '$field', type: 'string', value: 'text' } } }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string
var serialized = "{{";
// Check for tiddler attribute
if(tree.attributes.$tiddler) {

View File

@ -84,9 +84,6 @@ exports.parse = function() {
};
exports.serialize = function (tree, serialize) {
// tree: { type: 'element', tag: 'pre', children: [{ type: 'text', text: 'This will be rendered as JavaScript' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the opening delimiter and type
var serialized = '$$$'; // Extract the type from the tree node (assuming it's stored in a specific attribute)
if(tree.attributes && tree.attributes.type) {
serialized += tree.attributes.type.value;

View File

@ -66,11 +66,9 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'link', attributes: { to: { type: 'string', value: 'AWikiLink' } }, children: [{ type: 'text', text: 'AWikiLink' }] }
// serialize: function that accepts array of nodes or a node and returns a string
// Check if the link is suppressed
var isSuppressed = tree.children[0].text.substr(0,1) === $tw.config.textPrimitives.unWikiLink;
// Initialize the serialized string
var serialized = isSuppressed ? $tw.config.textPrimitives.unWikiLink : "";
// Append the link text
serialized += tree.attributes.to.value;

View File

@ -38,9 +38,6 @@ exports.parse = function() {
};
exports.serialize = function(tree, serialize) {
// tree: { type: 'text', text: 'SuppressedLink' }
// serialize: function that accepts array of nodes or a node and returns a string
// Initialize the serialized string with the unwikilink character
var serialized = $tw.config.textPrimitives.unWikiLink;
// Append the text
serialized += tree.text;