This commit is contained in:
Gavin Nishizawa 2023-02-28 13:22:05 -08:00
parent 08bcc7477a
commit afb70dd526
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD

View file

@ -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++
}