diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-07-21 03:59:15 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2026-02-20 13:28:04 -0500 |
| commit | 745f7a50ebe2583b9badd371fc2a6f394148c88b (patch) | |
| tree | 2aceff28e4508a85f0c4c20413021addb41a0e77 /plugins | |
| parent | b6318ac246e1da39b4b9a411dc79d5c2300ca04f (diff) | |
Dynamic markdown page generation with preloading
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/withMarkdownLoader.js | 12 |
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 } ] }); |
