From d9d7fc1ab4a727cc417e465c9396c9764c1da99d Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 21 Apr 2023 00:44:55 +0100 Subject: [PATCH] fix: aplayer dration error --- src/markdown/rehype-audio.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/markdown/rehype-audio.ts b/src/markdown/rehype-audio.ts index 2f40c9c3..6d900b2a 100644 --- a/src/markdown/rehype-audio.ts +++ b/src/markdown/rehype-audio.ts @@ -29,8 +29,9 @@ export const rehypeAudio: Plugin, Root> = ({ first = false } - if (parent) { - parent.children[i!] = { + if (parent && parent.type === "element" && i !== null) { + parent.tagName = "div" + parent.children[i] = { type: "element", tagName: "audio", properties: {