From 42b965c9f023c57609d0f2e56db840544c5d960c Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sun, 1 Nov 2020 18:14:42 +0100 Subject: [PATCH] Init less parsers (#4954) * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * Don't override browser selection colours by default Reverts some of #4590 * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * add a new-line before the log text to increase readability of the test output * make eslint, jslint happy * it shouldn't be there * fremove this file from my PRs * list-widget, init new Parser() only if needed. * fix braces Co-authored-by: jeremy@jermolene.com --- core/modules/widgets/list.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/list.js b/core/modules/widgets/list.js index f4981df33..786ce42a9 100755 --- a/core/modules/widgets/list.js +++ b/core/modules/widgets/list.js @@ -87,8 +87,14 @@ ListWidget.prototype.getTiddlerList = function() { }; ListWidget.prototype.getEmptyMessage = function() { - var emptyMessage = this.getAttribute("emptyMessage",""), - parser = this.wiki.parseText("text/vnd.tiddlywiki",emptyMessage,{parseAsInline: true}); + var parser, + emptyMessage = this.getAttribute("emptyMessage",""); + // this.wiki.parseText() calls + // new Parser(..), which should only be done, if needed, because it's heavy! + if (emptyMessage === "") { + return []; + } + parser = this.wiki.parseText("text/vnd.tiddlywiki",emptyMessage,{parseAsInline: true}); if(parser) { return parser.tree; } else {