From 437268370661087dbe31323efb18dfe1a518da33 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Wed, 21 Jul 2021 03:59:15 -0500 Subject: Dynamic markdown page generation with preloading --- plugins/withMarkdownLoader.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'plugins/withMarkdownLoader.js') 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 } ] }); -- cgit v1.2.3