diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-05-28 19:37:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 19:37:38 +0200 |
commit | e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3 (patch) | |
tree | 5907dcfb581662b7a47a6059f3e070349a327212 /src | |
parent | Environmental variables for dev/production mode (#1455) (diff) | |
download | ferdium-app-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.tar.gz ferdium-app-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.tar.zst ferdium-app-e28934f050b3e2ff6cf5fcf5cb0e4baa951909a3.zip |
Read CSS assets in recipes as utf8 (#1459)
Extracted from 357b23b69c119e3d10926613ca31588d5c7285fc according to
https://github.com/getferdi/ferdi/pull/1456#discussion_r641185050
Diffstat (limited to 'src')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index a9a3a1f51..bb2052107 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 | ||