arvid-e пре 9 месеци
родитељ
комит
8fe97bd117
1 измењених фајлова са 1 додато и 11 уклоњено
  1. 1 11
      apps/app/src/services/renderer/remark-plugins/codeblock.ts

+ 1 - 11
apps/app/src/services/renderer/remark-plugins/codeblock.ts

@@ -3,7 +3,7 @@ import type { Schema as SanitizeOption } from 'hast-util-sanitize';
 import type { InlineCode as MdastInlineCode, Html, Text } from 'mdast';
 import type { InlineCode as MdastInlineCode, Html, Text } from 'mdast';
 import type { Plugin } from 'unified';
 import type { Plugin } from 'unified';
 import type { Node, Parent, Point } from 'unist';
 import type { Node, Parent, Point } from 'unist';
-import type { visit as unistUtilVisit } from 'unist-util-visit';
+import { visit } from 'unist-util-visit';
 
 
 
 
 type InlineCode = MdastInlineCode & {
 type InlineCode = MdastInlineCode & {
@@ -13,12 +13,6 @@ type InlineCode = MdastInlineCode & {
   };
   };
 };
 };
 
 
-let visit: typeof unistUtilVisit;
-(async() => {
-  const { visit: loadedVisit } = await import('unist-util-visit');
-  visit = loadedVisit;
-})();
-
 const SUPPORTED_CODE = ['inline'];
 const SUPPORTED_CODE = ['inline'];
 
 
 /**
 /**
@@ -34,10 +28,6 @@ const SUPPORTED_CODE = ['inline'];
 
 
 export const remarkPlugin: Plugin = () => {
 export const remarkPlugin: Plugin = () => {
   return (tree: Node) => {
   return (tree: Node) => {
-    if (!visit) {
-      return tree;
-    }
-
     const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
     const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
 
 
     visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {
     visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {