Skip to content

Commit

Permalink
Wrap label value with dot.Literal
Browse files Browse the repository at this point in the history
Semantics of Attr changed so that quotes were being added around the
string passed as val. Need to wrap the string with dot.Literal to treat
the string as literal. =.=
  • Loading branch information
aashishkarki authored and aashishkarki committed May 17, 2020
1 parent 1af3741 commit 571216b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/draw/dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ func ERD(tables []models.TableAndColumns, fks []models.ForeignKey) (dot.Graph, e
}
n := g.Node(table.Name).Box()
n.Attr("shape", "plaintext")
n.Attr("label", fmt.Sprintf(`<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"><TR><TD colspan="2">%s</TD></TR>%s</TABLE>>`,
table.Name, cols))
n.Attr("label", dot.Literal(
fmt.Sprintf(`<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"><TR><TD colspan="2">%s</TD></TR>%s</TABLE>>`,
table.Name, cols)))
tableToNode[table.Name] = n
}

Expand Down

0 comments on commit 571216b

Please sign in to comment.