From afb70dd5261d4434b93169386445e7bfe0d00cad Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Tue, 28 Feb 2023 13:22:05 -0800 Subject: [PATCH] cleanup --- d2renderers/d2svg/appendix/appendix.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/d2renderers/d2svg/appendix/appendix.go b/d2renderers/d2svg/appendix/appendix.go index 2575edcd0..4d2b61ca1 100644 --- a/d2renderers/d2svg/appendix/appendix.go +++ b/d2renderers/d2svg/appendix/appendix.go @@ -93,9 +93,8 @@ func Append(diagram *d2target.Diagram, ruler *textmeasure.Ruler, in []byte) []by newViewbox := fmt.Sprintf(`viewBox="%s %s %s %s"`, viewboxSlice[0], viewboxSlice[1], strconv.Itoa(viewboxWidth), strconv.Itoa(viewboxHeight)) // check if outer svg has dimensions set - svgMatches := svgRegex.FindAllStringSubmatch(svg, 2) dimensionsToUpdate := 2 - if widthRegex.FindString(svgMatches[0][0]) != "" { + if widthRegex.FindString(svgRegex.FindString(svg)) != "" { dimensionsToUpdate++ }