From b48f110250e721d6f8449d5ad80f6a36e688bed2 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Wed, 20 Sep 2023 21:33:09 +0200 Subject: [PATCH] Fix type error --- index.ts | 3 ++- package-lock.json | 1 + package.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index b112481..34135fd 100644 --- a/index.ts +++ b/index.ts @@ -1,3 +1,4 @@ +import { type ElementContent } from 'hast' import { fromHtmlIsomorphic } from 'hast-util-from-html-isomorphic' import { type BlockContent, type Code, type Parent, type Root } from 'mdast' import { @@ -57,7 +58,7 @@ const remarkMermaid: Plugin<[RemarkMermaidOptions?], Root> = (options) => { if (result.status === 'fulfilled') { const { svg } = result.value - const hChildren = fromHtmlIsomorphic(svg, { fragment: true }).children + const hChildren = fromHtmlIsomorphic(svg, { fragment: true }).children as ElementContent[] parent.children[nodeIndex] = { type: 'paragraph', children: [{ type: 'html', value: svg }], diff --git a/package-lock.json b/package-lock.json index fbd401b..ad5e99d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@playwright/test": "^1.0.0", + "@types/hast": "^3.0.0", "c8": "^8.0.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^10.0.0", diff --git a/package.json b/package.json index f449b13..79ffeff 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ }, "devDependencies": { "@playwright/test": "^1.0.0", + "@types/hast": "^3.0.0", "c8": "^8.0.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^10.0.0",