Replace message if Hugo generated html contains a specific html <text> value

Hi, using a Hugo shortcode to render mermaid diagrams in docs. When a page is loaded, mermaid dynamically generates the html, css, an image and so on. If a problem occurs, Mermaid shows an error message inside the tag like so:

<text class="error-text" x="1240" y="250" font-size="150px" style="text-anchor: middle;">Syntax error in graph</text>

Wondering if there is a “Hugo way” to detect class="error-text" in the rendered html and replace the Syntax error in graph message with something else. Running 0.87.0, Docsy template and Mermaid 9.0.0.

Kubernetes docs repo

No, because the diagram is rendered in the client, long after Hugo has built the site.

That’s what I thought, tx.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.