aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-05-28 19:37:38 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-28 19:37:38 +0200
commite28934f050b3e2ff6cf5fcf5cb0e4baa951909a3 (patch)
tree5907dcfb581662b7a47a6059f3e070349a327212
parentEnvironmental variables for dev/production mode (#1455) (diff)
downloadferdi-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.tar.gz
ferdi-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.tar.zst
ferdi-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.zip
Read CSS assets in recipes as utf8 (#1459)
Extracted from 357b23b69c119e3d10926613ca31588d5c7285fc according to https://github.com/getferdi/ferdi/pull/1456#discussion_r641185050
-rw-r--r--src/webview/lib/RecipeWebview.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js
index a9a3a1f5..bb205210 100644
--- a/src/webview/lib/RecipeWebview.js
+++ b/src/webview/lib/RecipeWebview.js
@@ -75,9 +75,9 @@ class RecipeWebview {
75 injectCSS(...files) { 75 injectCSS(...files) {
76 files.forEach(async (file) => { 76 files.forEach(async (file) => {
77 if (await fs.exists(file)) { 77 if (await fs.exists(file)) {
78 const data = await fs.readFile(file); 78 const data = await fs.readFile(file, 'utf8');
79 const styles = document.createElement('style'); 79 const styles = document.createElement('style');
80 styles.innerHTML = data.toString(); 80 styles.innerHTML = data;
81 81
82 document.querySelector('head').appendChild(styles); 82 document.querySelector('head').appendChild(styles);
83 83