reiji-h 1 год назад
Родитель
Сommit
f6d4dba2cf
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/remark-drawio/src/services/renderer/remark-drawio.ts

+ 2 - 2
packages/remark-drawio/src/services/renderer/remark-drawio.ts

@@ -1,6 +1,6 @@
 import type { Schema as SanitizeOption } from 'hast-util-sanitize';
 import type { Schema as SanitizeOption } from 'hast-util-sanitize';
 import type {
 import type {
-  Code, Node, Parent,
+  Code, Node, Paragraph,
 } from 'mdast';
 } from 'mdast';
 import type { Plugin } from 'unified';
 import type { Plugin } from 'unified';
 import { visit } from 'unist-util-visit';
 import { visit } from 'unist-util-visit';
@@ -28,7 +28,7 @@ function isDrawioBlock(lang?: string | null): lang is Lang {
 function rewriteNode(node: Node, index: number) {
 function rewriteNode(node: Node, index: number) {
 
 
   node.type = 'paragraph';
   node.type = 'paragraph';
-  (node as Parent).children = [{ type: 'text', value: (node as Code).value }];
+  (node as Paragraph).children = [{ type: 'text', value: (node as Code).value }];
 
 
   const data = node.data ?? (node.data = {});
   const data = node.data ?? (node.data = {});
   data.hName = 'drawio';
   data.hName = 'drawio';