mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 07:26:54 +00:00
fix: render invisible comment and parsemode as data element
This commit is contained in:
parent
2a75077747
commit
c39297698f
@ -55,7 +55,8 @@ exports.parse = function() {
|
|||||||
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
||||||
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||||
return [{
|
return [{
|
||||||
type: "commentblock",
|
type: "element",
|
||||||
|
tag: "data",
|
||||||
text: commentText,
|
text: commentText,
|
||||||
start: commentStart,
|
start: commentStart,
|
||||||
end: commentEnd
|
end: commentEnd
|
||||||
|
@ -48,7 +48,8 @@ exports.parse = function() {
|
|||||||
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
||||||
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||||
return [{
|
return [{
|
||||||
type: "commentinline",
|
type: "element",
|
||||||
|
tag: "data",
|
||||||
text: commentText,
|
text: commentText,
|
||||||
start: commentStart,
|
start: commentStart,
|
||||||
end: commentEnd
|
end: commentEnd
|
||||||
|
@ -89,7 +89,7 @@ exports.parse = function() {
|
|||||||
return parseTreeNodes;
|
return parseTreeNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.serialize = function(tree) {
|
exports.serialize = function(tree,serialize) {
|
||||||
// Macro name
|
// Macro name
|
||||||
var name = tree.attributes.name.value;
|
var name = tree.attributes.name.value;
|
||||||
// Parameters
|
// Parameters
|
||||||
|
@ -57,7 +57,7 @@ exports.parse = function() {
|
|||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.serialize = function(tree) {
|
exports.serialize = function(tree,serialize) {
|
||||||
// Parameters
|
// Parameters
|
||||||
var params = tree.orderedAttributes.map(function(param) {
|
var params = tree.orderedAttributes.map(function(param) {
|
||||||
return param.name + (param.value ? ":" + param.value : "");
|
return param.name + (param.value ? ":" + param.value : "");
|
||||||
|
@ -63,7 +63,8 @@ exports.parse = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [{
|
return [{
|
||||||
type: "parsermode",
|
type: "element",
|
||||||
|
tag: "data",
|
||||||
parseAsInline: this.parser.parseAsInline,
|
parseAsInline: this.parser.parseAsInline,
|
||||||
start: start,
|
start: start,
|
||||||
end: this.parser.pos
|
end: this.parser.pos
|
||||||
|
@ -133,7 +133,7 @@ exports.serializeParseTree = function serializeParseTree(tree,tiddlerType) {
|
|||||||
$tw.utils.each(tree,function(node) {
|
$tw.utils.each(tree,function(node) {
|
||||||
output.push(serializeParseTree(node,tiddlerType));
|
output.push(serializeParseTree(node,tiddlerType));
|
||||||
});
|
});
|
||||||
} else {
|
} else if(tree) {
|
||||||
if(tree.type === "text" && !tree.rule) {
|
if(tree.type === "text" && !tree.rule) {
|
||||||
output.push(tree.text);
|
output.push(tree.text);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user