escape text

This commit is contained in:
Gavin Nishizawa 2023-03-06 20:07:26 -08:00
parent 226640fde5
commit edaf5de5c0
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -868,7 +868,8 @@ func render3dHexagon(targetShape d2target.Shape) string {
func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2sketch.Runner) (labelMask string, err error) { func drawShape(writer io.Writer, targetShape d2target.Shape, sketchRunner *d2sketch.Runner) (labelMask string, err error) {
closingTag := "</g>" closingTag := "</g>"
if targetShape.Link != "" { if targetShape.Link != "" {
fmt.Fprintf(writer, `<a href="%s" xlink:href="%[1]s">`, targetShape.Link)
fmt.Fprintf(writer, `<a href="%s" xlink:href="%[1]s">`, svg.EscapeText(targetShape.Link))
closingTag += "</a>" closingTag += "</a>"
} }
// Opacity is a unique style, it applies to everything for a shape // Opacity is a unique style, it applies to everything for a shape