x4js 1.4.26 → 1.4.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/icon.ts CHANGED
@@ -101,7 +101,8 @@ class Loader extends EventSource<LoadingEventMap> {
101
101
  if( r.ok ) {
102
102
  const svg = await r.text();
103
103
  // check response, must be svg
104
- if( !svg.startsWith("<svg") ) {
104
+ //TODO: find better
105
+ if (!svg.startsWith("<svg") && !svg.startsWith('<?xml') ) {
105
106
  console.error( "svg loading error: ", svg );
106
107
  this.signal( 'loaded', EvLoaded(url,"") );
107
108
  }
@@ -225,13 +226,10 @@ export class Icon extends Component<IconProps>
225
226
  let match_url = reUrl.exec( icon );
226
227
  if( match_url ) {
227
228
  url = trimQuotes( match_url[1].trim( ) );
228
- if( url.substring(0,5)=='data:' ) {
229
- this._setSVG( url );
230
- return;
231
- }
232
- else {
233
- name = url.replace( /[/\\\.\* ]/g, '_' );
234
- }
229
+ // this value is escaped
230
+ url = url.replaceAll( "\\", "" );
231
+ this._setSVG( url );
232
+ return;
235
233
  }
236
234
  else {
237
235
  // todo: deprecated
package/src/tools.ts CHANGED
@@ -369,10 +369,11 @@ export function escapeHtml(unsafe: string, nl_br = false): string {
369
369
  */
370
370
 
371
371
  export function removeHtmlTags(unsafe: string, nl_br = false): string {
372
- if (!unsafe || unsafe.length == 0) {
373
- return unsafe;
374
- }
375
- debugger;
372
+
373
+ if ( unsafe===undefined || unsafe===null || !isString(unsafe) || unsafe.length == 0 ) {
374
+ return "";
375
+ }
376
+
376
377
  let ret_val = '';
377
378
  for (let i = 0; i < unsafe.length; i++) {
378
379
  const ch = unsafe.codePointAt(i);