From feec0635b14f2cfbd0907f5b6efb9e612b4d2890 Mon Sep 17 00:00:00 2001 From: Denis Migdal Date: Sat, 27 Jul 2024 12:57:51 +0200 Subject: [PATCH] Quick fix to enable usage of Marker extensions --- src/loader.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/loader.js b/src/loader.js index dc33cfa..b0d3fab 100644 --- a/src/loader.js +++ b/src/loader.js @@ -1,8 +1,18 @@ /* eslint-disable @babel/no-invalid-this */ -import { parse } from "marked"; +import {parse, use} from "marked"; + +const extensions = []; export function markdownLoader(markdown) { const options = this.getOptions(); - return parse(markdown, options); + for(let extension of options.extensions) { + if( extensions.includes(extension) ) + break; + + use(extension); + extensions.push(extension); + } + + return parse(markdown, options.options); }