diff --git a/www/src/ts/utils.ts b/www/src/ts/utils.ts index 594b0ed..033f4b8 100644 --- a/www/src/ts/utils.ts +++ b/www/src/ts/utils.ts @@ -181,9 +181,11 @@ export function parseNumber(s: string): number { if (/^\$[0-9A-Fa-f]+$/.test(s)) { return parseInt(s.slice(1), 16) } - const hex = parseHex(s); - if (!isNaN(hex)) { - return hex; + if (/[a-fA-F]/.test(s)) { + const hex = parseHex(s); + if (!isNaN(hex)) { + return hex; + } } return parseFloat(s); } @@ -204,9 +206,11 @@ export function parseIntWithHexOrBinary(s: string): number { if (/^\$[0-9A-Fa-f]+$/.test(s)) { return parseInt(s.slice(1), 16) } - const hex = parseHex(s); - if (!isNaN(hex)) { - return hex; + if (/[a-fA-F]/.test(s)) { + const hex = parseHex(s); + if (!isNaN(hex)) { + return hex; + } } return parseInt(s); } diff --git a/www/src/ts/virtual_machine/device.ts b/www/src/ts/virtual_machine/device.ts index 71c0ac7..2b7c022 100644 --- a/www/src/ts/virtual_machine/device.ts +++ b/www/src/ts/virtual_machine/device.ts @@ -460,7 +460,7 @@ export class VMDeviceList extends BaseElement { protected render(): HTMLTemplateResult { const deviceCards: HTMLTemplateResult[] = this.filteredDeviceIds.map( (id, _index, _ids) => - html`< vm - device - card.deviceID=${ id } class="device-list-card" > `, + html` `, ); const result = html`