x4js 1.4.27 → 1.4.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/icon.js +6 -8
- package/lib/tools.js +2 -3
- package/package.json +1 -1
package/lib/icon.js
CHANGED
|
@@ -76,7 +76,8 @@ class Loader extends x4events_1.EventSource {
|
|
|
76
76
|
if (r.ok) {
|
|
77
77
|
const svg = await r.text();
|
|
78
78
|
// check response, must be svg
|
|
79
|
-
|
|
79
|
+
//TODO: find better
|
|
80
|
+
if (!svg.startsWith("<svg") && !svg.startsWith('<?xml')) {
|
|
80
81
|
console.error("svg loading error: ", svg);
|
|
81
82
|
this.signal('loaded', EvLoaded(url, ""));
|
|
82
83
|
}
|
|
@@ -180,13 +181,10 @@ class Icon extends component_1.Component {
|
|
|
180
181
|
let match_url = reUrl.exec(icon);
|
|
181
182
|
if (match_url) {
|
|
182
183
|
url = trimQuotes(match_url[1].trim());
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
else {
|
|
188
|
-
name = url.replace(/[/\\\.\* ]/g, '_');
|
|
189
|
-
}
|
|
184
|
+
// this value is escaped
|
|
185
|
+
url = url.replaceAll("\\", "");
|
|
186
|
+
this._setSVG(url);
|
|
187
|
+
return;
|
|
190
188
|
}
|
|
191
189
|
else {
|
|
192
190
|
// todo: deprecated
|
package/lib/tools.js
CHANGED
|
@@ -300,10 +300,9 @@ exports.escapeHtml = escapeHtml;
|
|
|
300
300
|
* console.log( removeHtmlTags('<h1>sss</h1>') );
|
|
301
301
|
*/
|
|
302
302
|
function removeHtmlTags(unsafe, nl_br = false) {
|
|
303
|
-
if (!unsafe || unsafe.length == 0) {
|
|
304
|
-
return
|
|
303
|
+
if (unsafe === undefined || unsafe === null || !isString(unsafe) || unsafe.length == 0) {
|
|
304
|
+
return "";
|
|
305
305
|
}
|
|
306
|
-
debugger;
|
|
307
306
|
let ret_val = '';
|
|
308
307
|
for (let i = 0; i < unsafe.length; i++) {
|
|
309
308
|
const ch = unsafe.codePointAt(i);
|