From a0708a17cb9c3f43e26752e0a3233f69bbf6baf1 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Thu, 13 Jun 2024 01:29:22 +0800 Subject: [PATCH] Revert "feat: allow $tw.utils.getParseTreeText to render other rules' text" This reverts commit 8a12498fa96aa76973a6dbd8d28698bd3ef4418e. --- core/modules/utils/parsetree.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/modules/utils/parsetree.js b/core/modules/utils/parsetree.js index 7e7542d34..a74b8f3f8 100644 --- a/core/modules/utils/parsetree.js +++ b/core/modules/utils/parsetree.js @@ -106,7 +106,7 @@ exports.findParseTreeNode = function(nodeArray,search) { /* Helper to get the text of a parse tree node or array of nodes */ -exports.getParseTreeText = function getParseTreeText(tree, tiddlerType) { +exports.getParseTreeText = function getParseTreeText(tree) { var output = []; if($tw.utils.isArray(tree)) { $tw.utils.each(tree,function(node) { @@ -115,14 +115,6 @@ exports.getParseTreeText = function getParseTreeText(tree, tiddlerType) { } else { if(tree.type === "text") { output.push(tree.text); - } else { - var Parser = $tw.wiki.getParser(tiddlerType); - var Rule = Parser.prototype.blockRuleClasses[tree.type] || - Parser.prototype.inlineRuleClasses[tree.type] || - Parser.prototype.pragmaRuleClasses[tree.type]; - if(Rule && Rule.prototype.getText) { - output.push(Rule.prototype.getText(tree)); - } } if(tree.children) { return getParseTreeText(tree.children);