Skip to content

Commit

Permalink
updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rjwignar committed Mar 26, 2024
1 parent 86ef79d commit 2d51fce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/NomnomlPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ const NomnomlPreview = ({ children }: NomnomlPreviewProps) => {

const fetchNomnoml = async () => {
try {
// Load nomnoml dynamically at runtime if needed
const nomnoml = await import("nomnoml");
const svg = await nomnoml.renderSvg(code);

setValue(svg);
diagramDiv.innerHTML = svg;

// Adjust the width of the SVG to fit the content
// Adjust the width of the SVG to fit the content inside the CardBody
const svgElement = diagramDiv.querySelector("svg");
if (svgElement) {
svgElement.style.width = "100%";
Expand Down

0 comments on commit 2d51fce

Please sign in to comment.