@lowlighter/markdown 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/deno.jsonc +3 -3
- package/deno.lock +42 -42
- package/mod.mjs +1 -1
- package/package.json +1 -1
- package/plugins/directives.mjs +1 -1
- package/plugins/emojis.mjs +1 -1
- package/plugins/frontmatter.mjs +1 -1
- package/plugins/gfm.mjs +1 -1
- package/plugins/highlighting.mjs +1 -1
- package/plugins/linebreaks.mjs +1 -1
- package/plugins/math.mjs +1 -1
- package/plugins/mermaid.mjs +1 -1
- package/plugins/mod.mjs +1 -1
- package/renderer.mjs +1 -1
- package/renderer.ts +3 -3
package/renderer.ts
CHANGED
|
@@ -109,10 +109,10 @@ export class Renderer {
|
|
|
109
109
|
*/
|
|
110
110
|
static async with({ plugins = [], throw: throws = true }: { plugins: Array<Plugin | URL | string>; throw?: boolean }): Promise<Renderer> {
|
|
111
111
|
plugins = plugins.map((plugin) => plugin instanceof URL ? plugin.href : plugin)
|
|
112
|
-
const imported = await Promise.allSettled(plugins.map((plugin) => (typeof plugin === "string") ? import(plugin) : plugin))
|
|
112
|
+
const imported = await Promise.allSettled(plugins.map((plugin) => (typeof plugin === "string") ? import(plugin) : { default: plugin }))
|
|
113
113
|
const resolved = imported
|
|
114
|
-
.filter((result): result is PromiseFulfilledResult<Plugin> => result.status === "fulfilled")
|
|
115
|
-
.map(({ value }) => value)
|
|
114
|
+
.filter((result): result is PromiseFulfilledResult<{ default: Plugin }> => result.status === "fulfilled")
|
|
115
|
+
.map(({ value }) => value.default)
|
|
116
116
|
if (throws && (imported.some(({ status }) => status === "rejected"))) {
|
|
117
117
|
const errors = imported
|
|
118
118
|
.filter((result): result is PromiseRejectedResult => result.status === "rejected")
|