diff --git a/core/modules/parsers/wikiparser/rules/commentblock.js b/core/modules/parsers/wikiparser/rules/commentblock.js index 56a0857dd..1e9b2c622 100644 --- a/core/modules/parsers/wikiparser/rules/commentblock.js +++ b/core/modules/parsers/wikiparser/rules/commentblock.js @@ -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); }; })(); diff --git a/core/modules/parsers/wikiparser/rules/commentinline.js b/core/modules/parsers/wikiparser/rules/commentinline.js index 5ddcd8c82..01f76c1c6 100644 --- a/core/modules/parsers/wikiparser/rules/commentinline.js +++ b/core/modules/parsers/wikiparser/rules/commentinline.js @@ -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 diff --git a/core/modules/parsers/wikiparser/rules/parsermode.js b/core/modules/parsers/wikiparser/rules/parsermode.js index 713bb36ed..9aea958d2 100644 --- a/core/modules/parsers/wikiparser/rules/parsermode.js +++ b/core/modules/parsers/wikiparser/rules/parsermode.js @@ -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 diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index eb84fab4a..73c299d69 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -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) { diff --git a/plugins/tiddlywiki/jasmine/jasmine-plugin.js b/plugins/tiddlywiki/jasmine/jasmine-plugin.js index 488377b44..8dbf6568e 100644 --- a/plugins/tiddlywiki/jasmine/jasmine-plugin.js +++ b/plugins/tiddlywiki/jasmine/jasmine-plugin.js @@ -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() {