mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-20 22:16:52 +00:00
feat: add void: true, in ast node to prevent render
This commit is contained in:
parent
c39297698f
commit
b22ca2b3df
@ -55,8 +55,8 @@ exports.parse = function() {
|
||||
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
||||
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||
return [{
|
||||
type: "element",
|
||||
tag: "data",
|
||||
type: "comment",
|
||||
void: true,
|
||||
text: commentText,
|
||||
start: commentStart,
|
||||
end: commentEnd
|
||||
@ -64,7 +64,7 @@ exports.parse = function() {
|
||||
};
|
||||
|
||||
exports.serialize = function(tree, serialize) {
|
||||
return tree.text + "\n\n";
|
||||
return tree.text + "\n\n" + serialize(tree.children);
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -48,8 +48,8 @@ exports.parse = function() {
|
||||
var commentEnd = this.endMatch.index + this.endMatch[0].length;
|
||||
var commentText = this.parser.source.slice(commentStart, commentEnd);
|
||||
return [{
|
||||
type: "element",
|
||||
tag: "data",
|
||||
type: "comment",
|
||||
void: true,
|
||||
text: commentText,
|
||||
start: commentStart,
|
||||
end: commentEnd
|
||||
|
@ -63,8 +63,8 @@ exports.parse = function() {
|
||||
}
|
||||
}
|
||||
return [{
|
||||
type: "element",
|
||||
tag: "data",
|
||||
type: "parsermode",
|
||||
void: true,
|
||||
parseAsInline: this.parser.parseAsInline,
|
||||
start: start,
|
||||
end: this.parser.pos
|
||||
|
@ -553,7 +553,8 @@ Widget.prototype.makeChildWidget = function(parseTreeNode,options) {
|
||||
var WidgetClass = this.widgetClasses[parseTreeNode.type];
|
||||
if(!WidgetClass) {
|
||||
WidgetClass = this.widgetClasses.text;
|
||||
parseTreeNode = {type: "text", text: "Undefined widget '" + parseTreeNode.type + "'"};
|
||||
// Skip void node that is not intended for render. Show error for missing widgets.
|
||||
parseTreeNode = {type: "text", text: parseTreeNode.void ? "" : "Undefined widget '" + parseTreeNode.type + "'"};
|
||||
}
|
||||
// Create set variable widgets for each variable
|
||||
$tw.utils.each(options.variables,function(value,name) {
|
||||
|
@ -12,8 +12,7 @@ The main module of the Jasmine test plugin for TiddlyWiki5
|
||||
/*global $tw: true */
|
||||
"use strict";
|
||||
|
||||
// DEBUG: only run my tests for development, remove before PR merge
|
||||
var TEST_TIDDLER_FILTER = "[[test-wikitext-serialize.js]]";
|
||||
var TEST_TIDDLER_FILTER = "[all[tiddlers+shadows]type[application/javascript]tag[$:/tags/test-spec]]";
|
||||
var TESTS_DONE = false;
|
||||
|
||||
exports.testsWereRun = function() {
|
||||
|
Loading…
Reference in New Issue
Block a user