Class FixSvgMojo
java.lang.Object
network.ike.docs.plugin.FixSvgMojo
- All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
@Mojo(name="fix-svg",
defaultPhase="process-resources")
public class FixSvgMojo
extends Object
implements org.apache.maven.api.plugin.Mojo
Remove bare
<rect/> elements from generated HTML files.
Mermaid generates <rect/> elements (no attributes) as
non-functional placeholders inside flowchart label groups. These
elements violate the SVG spec (missing required width/height) and
cause warnings in Prince and other PDF renderers.
Replaces: fix-inline-svg.sh
Usage:
mvn ike:fix-svg -DhtmlFile=target/generated-docs/html/document.html
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcountBareRects(String html) Count occurrences of bare<rect/>elements in HTML content.voidexecute()protected org.apache.maven.api.plugin.LoggetLog()Access the Maven logger.static StringremoveBareRects(String html) Remove all bare<rect/>elements from HTML content.
-
Constructor Details
-
FixSvgMojo
public FixSvgMojo()Creates this goal instance.
-
-
Method Details
-
getLog
protected org.apache.maven.api.plugin.Log getLog()Access the Maven logger.- Returns:
- the logger
-
execute
public void execute() throws org.apache.maven.api.plugin.MojoException- Specified by:
executein interfaceorg.apache.maven.api.plugin.Mojo- Throws:
org.apache.maven.api.plugin.MojoException
-
removeBareRects
-
countBareRects
Count occurrences of bare<rect/>elements in HTML content.- Parameters:
html- the HTML content- Returns:
- number of bare rect elements found
-