mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-05 23:10:28 +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 commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||
return [{
|
||||
type: "commentblock",
|
||||
type: "element",
|
||||
tag: "data",
|
||||
text: commentText,
|
||||
start: commentStart,
|
||||
end: commentEnd
|
||||
|
@ -48,7 +48,8 @@ exports.parse = function() {
|
||||
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
||||
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||
return [{
|
||||
type: "commentinline",
|
||||
type: "element",
|
||||
tag: "data",
|
||||
text: commentText,
|
||||
start: commentStart,
|
||||
end: commentEnd
|
||||
|
@ -89,7 +89,7 @@ exports.parse = function() {
|
||||
return parseTreeNodes;
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
// Macro name
|
||||
var name = tree.attributes.name.value;
|
||||
// Parameters
|
||||
|
@ -57,7 +57,7 @@ exports.parse = function() {
|
||||
}];
|
||||
};
|
||||
|
||||
exports.serialize = function(tree) {
|
||||
exports.serialize = function(tree,serialize) {
|
||||
// Parameters
|
||||
var params = tree.orderedAttributes.map(function(param) {
|
||||
return param.name + (param.value ? ":" + param.value : "");
|
||||
|
@ -63,7 +63,8 @@ exports.parse = function() {
|
||||
}
|
||||
}
|
||||
return [{
|
||||
type: "parsermode",
|
||||
type: "element",
|
||||
tag: "data",
|
||||
parseAsInline: this.parser.parseAsInline,
|
||||
start: start,
|
||||
end: this.parser.pos
|
||||
|
@ -133,7 +133,7 @@ exports.serializeParseTree = function serializeParseTree(tree,tiddlerType) {
|
||||
$tw.utils.each(tree,function(node) {
|
||||
output.push(serializeParseTree(node,tiddlerType));
|
||||
});
|
||||
} else {
|
||||
} else if(tree) {
|
||||
if(tree.type === "text" && !tree.rule) {
|
||||
output.push(tree.text);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user