|
|
@@ -3,15 +3,16 @@ import type { Schema as SanitizeOption } from 'hast-util-sanitize';
|
|
|
import type { InlineCode as MdastInlineCode, Html, Text } from 'mdast';
|
|
|
import type { Plugin } from 'unified';
|
|
|
import type { Node, Parent, Point } from 'unist';
|
|
|
+import type { visit as UnistUtilVisitFunction } from 'unist-util-visit';
|
|
|
|
|
|
+let visit: typeof UnistUtilVisitFunction;
|
|
|
|
|
|
-let visit: typeof import('unist-util-visit').visit;
|
|
|
-
|
|
|
-(async () => {
|
|
|
+(async() => {
|
|
|
const mod = await import('unist-util-visit');
|
|
|
visit = mod.visit;
|
|
|
})();
|
|
|
|
|
|
+
|
|
|
type InlineCode = MdastInlineCode & {
|
|
|
data?: {
|
|
|
hProperties?: Properties;
|
|
|
@@ -37,7 +38,7 @@ export const remarkPlugin: Plugin = () => {
|
|
|
const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
|
|
|
|
|
|
if (typeof visit === 'undefined') {
|
|
|
- return tree;
|
|
|
+ return tree;
|
|
|
}
|
|
|
|
|
|
visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {
|