Skip to content

Commit 7b55454

Browse files
committed
fix: default.css not found
1 parent 4add892 commit 7b55454

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

browser/components/MarkdownPreview.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ export default class MarkdownPreview extends React.Component {
170170
}
171171

172172
setCodeTheme (theme) {
173-
theme = consts.THEMES.some((_theme) => _theme === theme)
174-
? theme
175-
: 'default'
176-
this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/theme/${theme}.css`
173+
const pathToCss = consts.THEMES.some((_theme) => _theme === theme)
174+
? `theme/${theme}.css`
175+
: 'lib/codemirror.css'
176+
this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/${pathToCss}`
177177
}
178178

179179
rewriteIframe () {

browser/lib/consts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const consts = {
3030
'Dodger Blue',
3131
'Violet Eggplant'
3232
],
33-
THEMES: ['default'].concat(themes)
33+
THEMES: themes,
3434
}
3535

3636
module.exports = consts

0 commit comments

Comments
 (0)