diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 5cc4eca8..7a1f6815 100644 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -170,10 +170,10 @@ export default class MarkdownPreview extends React.Component { } setCodeTheme (theme) { - const pathToCss = consts.THEMES.some((_theme) => _theme === theme) - ? `theme/${theme}.css` - : 'lib/codemirror.css' - this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/${pathToCss}` + theme = consts.THEMES.some((_theme) => _theme === theme) + ? theme + : 'default' + this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/theme/${theme}.css` } rewriteIframe () { diff --git a/browser/lib/consts.js b/browser/lib/consts.js index fe108fd1..253bc974 100644 --- a/browser/lib/consts.js +++ b/browser/lib/consts.js @@ -30,7 +30,7 @@ const consts = { 'Dodger Blue', 'Violet Eggplant' ], - THEMES: themes, + THEMES: ['default'].concat(themes) } module.exports = consts