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 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
- if (!svg.startsWith("<svg")) {
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
- if (url.substring(0, 5) == 'data:') {
184
- this._setSVG(url);
185
- return;
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 unsafe;
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.27",
3
+ "version": "1.4.28",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",