mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-02 06:19:57 +00:00
lint: double quote
This commit is contained in:
parent
03798d7fef
commit
1a45520909
@ -386,33 +386,31 @@ exports.parseAttribute = function(source,pos) {
|
||||
};
|
||||
|
||||
/*
|
||||
Given a parsed attribute node, serialize it back into its source string representation.
|
||||
Serialize a parsed attribute node
|
||||
*/
|
||||
exports.serializeAttribute = function(node) {
|
||||
if(!node || typeof node !== 'object' || !node.name || !node.type) {
|
||||
return null;
|
||||
if(!node || typeof node !== "object" || !node.name || !node.type) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var attributeString = node.name;
|
||||
|
||||
if(node.type === 'string') {
|
||||
if(node.value === 'true') {
|
||||
return attributeString;
|
||||
}
|
||||
attributeString += '="' + node.value + '"';
|
||||
} else if(node.type === 'filtered') {
|
||||
attributeString += '={{{' + node.filter + '}}}';
|
||||
} else if(node.type === 'indirect') {
|
||||
attributeString += '={{' + node.textReference + '}}';
|
||||
} else if(node.type === 'substituted') {
|
||||
attributeString += '=`' + node.rawValue + '`';
|
||||
} else if(node.type === 'macro') {
|
||||
// Assuming macro serialization is complex and handled elsewhere
|
||||
attributeString += '=' + node.value.serialize();
|
||||
if(node.type === "string") {
|
||||
if(node.value === "true") {
|
||||
return attributeString;
|
||||
}
|
||||
attributeString += '="' + node.value + '"';
|
||||
} else if(node.type === "filtered") {
|
||||
attributeString += "={{{" + node.filter + "}}}";
|
||||
} else if(node.type === "indirect") {
|
||||
attributeString += "={{" + node.textReference + "}}";
|
||||
} else if(node.type === "substituted") {
|
||||
attributeString += "=`" + node.rawValue + "`";
|
||||
} else if(node.type === "macro") {
|
||||
// Assuming macro serialization is complex and handled elsewhere
|
||||
attributeString += "=" + node.value.serialize();
|
||||
} else {
|
||||
return null; // Unsupported type
|
||||
// Unsupported type
|
||||
return null;
|
||||
}
|
||||
|
||||
return attributeString;
|
||||
};
|
||||
|
||||
|
@ -259,7 +259,7 @@ WikiParser.prototype.parseBlock = function(terminatorRegExpString) {
|
||||
var start = this.pos;
|
||||
var children = this.parseInlineRun(terminatorRegExp);
|
||||
var end = this.pos;
|
||||
return [{type: "element", tag: "p", children: children, start: start, end: end, rule: 'parseBlock' }];
|
||||
return [{type: "element", tag: "p", children: children, start: start, end: end, rule: "parseBlock" }];
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user