Skip to content

Commit

Permalink
Set the markdown renderer on load (#1957)
Browse files Browse the repository at this point in the history
This resolves the issue where when displaying the EstimateDetails widget
sometimes there would be an error about the markdown renderer not being
set.
  • Loading branch information
billti authored Oct 10, 2024
1 parent 645412d commit dcd3543
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions widgets/js/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EstimatesPanel,
ReData,
Circuit,
setRenderer,
} from "qsharp-lang/ux";
import markdownIt from "markdown-it";

Expand All @@ -20,6 +21,7 @@ import mk from "@vscode/markdown-it-katex";

const md = markdownIt();
md.use(mk);
setRenderer((input: string) => md.render(input));

export function mdRenderer(input: string) {
// Note: Need to ensure this 'fix' is still needed with the latest data JSON.
Expand Down

0 comments on commit dcd3543

Please sign in to comment.