From 3b35411abadc3bcf0f569d7b848de13ff31dc2be Mon Sep 17 00:00:00 2001 From: cdruan <80615570+cdruan@users.noreply.github.com> Date: Fri, 2 Apr 2021 01:25:01 -0700 Subject: [PATCH] Change css-escape-polyfill to a tw uitility method (#5552) * Replace css-escape-polyfill.js with escapecss.js utility module * Add $tw.utils.escapeCSS() method and invoke that function within the escapecss operator. * Add test cases for the "escapecss" filter operator * Fix $tw.boot.doesTaskMatchPlatform() so it works as expected if a module's export.platforms contains more than one values * Add missed files to the last commit --- boot/boot.js | 19 ++++++-- core/modules/filters/encodings.js | 2 +- .../escapecss.js} | 44 +++++++------------ editions/test/tiddlers/tests/test-filters.js | 11 +++++ 4 files changed, 45 insertions(+), 31 deletions(-) rename core/modules/{startup/css-escape-polyfill.js => utils/escapecss.js} (75%) diff --git a/boot/boot.js b/boot/boot.js index 6e99863f8..ba780a109 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2467,16 +2467,29 @@ $tw.boot.executeNextStartupTask = function(callback) { }; /* -Returns true if we are running on one platforms specified in a task modules `platforms` array +Returns true if we are running on one of the platforms specified in taskModule's +`platforms` array; or if `platforms` property is not defined. */ $tw.boot.doesTaskMatchPlatform = function(taskModule) { var platforms = taskModule.platforms; if(platforms) { for(var t=0; t