We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0b6055 commit dda3501Copy full SHA for dda3501
packages/rehype-d2/src/d2.ts
@@ -7,12 +7,12 @@ export type D2Options = {
7
themeID?: number;
8
};
9
10
-const d2Instance = new D2();
11
-
12
export async function d2(
13
code: string,
14
options?: D2Options
15
): Promise<string> {
+ const d2Instance = new D2();
16
const result = await d2Instance.compile(code, options);
17
- return await d2Instance.render(result.diagram, options);
+ const svg = await d2Instance.render(result.diagram, options);
+ return svg
18
}
0 commit comments