We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f58b8d3 commit 76daa1cCopy full SHA for 76daa1c
src/core/platform.ts
@@ -75,7 +75,7 @@ export const platformApi: Platform = {
75
text = text || '';
76
font = font || DEFAULT_FONT;
77
// Use font size if there is no other method can be used.
78
- const res = /((\d+)?\.?\d*)px/.exec(font);
+ const res = /((?:\d+)?\.?\d*)px/.exec(font);
79
const fontSize = res && +res[1] || DEFAULT_FONT_SIZE;
80
let width = 0;
81
if (font.indexOf('mono') >= 0) { // is monospace
0 commit comments