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 +1 -1
- package/src/icon.ts +6 -8
- package/src/tools.ts +5 -4
package/package.json
CHANGED
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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);
|