Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Sep 17, 2023
1 parent a5cf37b commit 5d6b5d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/loaders/markdown/transformer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ async function applyUnifiedPlugin(opts: {
? opts.plugin
: [opts.plugin];

let mod: Plugin =
typeof plugin === 'function'
? plugin
: await import(plugin).then((module) => module.default);
let mod = typeof plugin === 'function' ? plugin : await import(plugin);

if (mod) opts.processor.use(mod, options);
const fn: Plugin = mod.default || mod;

opts.processor.use(fn, options);
}

export default async (raw: string, opts: IMdTransformerOptions) => {
Expand Down

0 comments on commit 5d6b5d0

Please sign in to comment.