aboutsummaryrefslogtreecommitdiff
path: root/plugins/withMarkdownLoader.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/withMarkdownLoader.js')
-rw-r--r--plugins/withMarkdownLoader.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/withMarkdownLoader.js b/plugins/withMarkdownLoader.js
index 7dd51b6..c1e0ac6 100644
--- a/plugins/withMarkdownLoader.js
+++ b/plugins/withMarkdownLoader.js
@@ -1,12 +1,6 @@
-const hljs = require('highlight.js');
const pluginFactory = require('./pluginFactory');
+const markedOptions = require('../utils/markedOptions');
-function highlight(code, lang) {
- const language = hljs.getLanguage(lang) ? lang : 'plaintext';
-
- const highlighted = hljs.highlight(code, { language }).value;
- return highlighted;
-}
const withMarkdownLoader = pluginFactory((config, _options) => {
config.module.rules.push({
@@ -20,9 +14,7 @@ const withMarkdownLoader = pluginFactory((config, _options) => {
},
{
loader: 'markdown-loader',
- options: {
- highlight
- }
+ options: markedOptions
}
]
});