From 2d51fce6e4cfab489212772c0d47bd8761380977 Mon Sep 17 00:00:00 2001 From: Roy Jeffrey Wignarajah Date: Tue, 26 Mar 2024 12:20:01 -0400 Subject: [PATCH] updated comments --- src/components/NomnomlPreview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/NomnomlPreview.tsx b/src/components/NomnomlPreview.tsx index 200b1b6f..ed7fc715 100644 --- a/src/components/NomnomlPreview.tsx +++ b/src/components/NomnomlPreview.tsx @@ -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%";