Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit b48f110

Browse files
committed
Fix type error
1 parent 5bba472 commit b48f110

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { type ElementContent } from 'hast'
12
import { fromHtmlIsomorphic } from 'hast-util-from-html-isomorphic'
23
import { type BlockContent, type Code, type Parent, type Root } from 'mdast'
34
import {
@@ -57,7 +58,7 @@ const remarkMermaid: Plugin<[RemarkMermaidOptions?], Root> = (options) => {
5758

5859
if (result.status === 'fulfilled') {
5960
const { svg } = result.value
60-
const hChildren = fromHtmlIsomorphic(svg, { fragment: true }).children
61+
const hChildren = fromHtmlIsomorphic(svg, { fragment: true }).children as ElementContent[]
6162
parent.children[nodeIndex] = {
6263
type: 'paragraph',
6364
children: [{ type: 'html', value: svg }],

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@playwright/test": "^1.0.0",
40+
"@types/hast": "^3.0.0",
4041
"c8": "^8.0.0",
4142
"eslint": "^8.0.0",
4243
"eslint-config-remcohaszing": "^10.0.0",

0 commit comments

Comments
 (0)