From 7ad97fb5d90755fefb41d9e6a42bc5771d923cd6 Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Thu, 16 Nov 2017 10:48:42 +1100 Subject: [PATCH] Handle font-family strings containing both single and double quotes. Fixes a failing unit test with WebKitGTK 2.18. * ui/composer-web-view.js (EditContext::init): Check for and strip both " and ' from start and end of font-family string. --- ui/composer-web-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/composer-web-view.js b/ui/composer-web-view.js index a0ab0970..63cea8e3 100644 --- a/ui/composer-web-view.js +++ b/ui/composer-web-view.js @@ -616,7 +616,7 @@ EditContext.prototype = { let styles = window.getComputedStyle(node); let fontFamily = styles.getPropertyValue("font-family"); - if (fontFamily.charAt() == "'") { + if (["'", "\""].indexOf(fontFamily.charAt()) != -1) { fontFamily = fontFamily.substr(1, fontFamily.length - 2); } this.fontFamily = fontFamily;