Skip to content

Commit dda3501

Browse files
committed
fix issues when there are many diagrams
1 parent f0b6055 commit dda3501

File tree

1 file changed

+3
-3
lines changed
  • packages/rehype-d2/src

1 file changed

+3
-3
lines changed

packages/rehype-d2/src/d2.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ export type D2Options = {
77
themeID?: number;
88
};
99

10-
const d2Instance = new D2();
11-
1210
export async function d2(
1311
code: string,
1412
options?: D2Options
1513
): Promise<string> {
14+
const d2Instance = new D2();
1615
const result = await d2Instance.compile(code, options);
17-
return await d2Instance.render(result.diagram, options);
16+
const svg = await d2Instance.render(result.diagram, options);
17+
return svg
1818
}

0 commit comments

Comments
 (0)