dave2wave commented on PR #68:
URL: https://github.com/apache/tooling-docs/pull/68#issuecomment-3592066986

   ```
   <script>
   document.addEventListener("DOMContentLoaded", () => {
   
     function decodeHtmlEntities(str) {
       const txt = document.createElement("textarea");
       txt.innerHTML = str;
       return txt.value;
     }
   
     document.querySelectorAll("pre > code.language-mermaid").forEach((code, i) 
=> {
       let decoded = decodeHtmlEntities(code.innerHTML);
   
       // Normalize whitespace
       decoded = decoded.replace(/\t/g, "    ");
       decoded = decoded.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
   
       const div = document.createElement("div");
       div.className = "mermaid";
       div.textContent = decoded;
   
       code.parentElement.replaceWith(div);
   
       console.log(`=== Mermaid block ${i} ===`);
       console.log(decoded);
     });
   
     // Mermaid v10+ runs asynchronously
     mermaid.run({ querySelector: ".mermaid" })
       .catch(err => {
         console.error("Mermaid rendering failed:", err);
       });
   });
   </script>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to