fix
This commit is contained in:
parent
aff6723d38
commit
f7a5689280
4 changed files with 19 additions and 9 deletions
|
|
@ -1364,8 +1364,8 @@ x -> y: {
|
|||
if len(g.Objects) != 1 {
|
||||
t.Fatal(g.Objects)
|
||||
}
|
||||
if g.Objects[0].Attributes.Link != "https://google.com" {
|
||||
t.Fatal(g.Objects[0].Attributes.Link)
|
||||
if g.Objects[0].Attributes.Link.Value != "https://google.com" {
|
||||
t.Fatal(g.Objects[0].Attributes.Link.Value)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -1380,8 +1380,8 @@ x -> y: {
|
|||
if len(g.Objects) != 1 {
|
||||
t.Fatal(g.Objects)
|
||||
}
|
||||
if g.Objects[0].Attributes.Link != "Overview.Untitled board 7.zzzzz" {
|
||||
t.Fatal(g.Objects[0].Attributes.Link)
|
||||
if g.Objects[0].Attributes.Link.Value != "Overview.Untitled board 7.zzzzz" {
|
||||
t.Fatal(g.Objects[0].Attributes.Link.Value)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -152,8 +152,12 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape {
|
|||
}
|
||||
}
|
||||
|
||||
shape.Tooltip = obj.Attributes.Tooltip
|
||||
shape.Link = obj.Attributes.Link
|
||||
if obj.Attributes.Tooltip != nil {
|
||||
shape.Tooltip = obj.Attributes.Tooltip.Value
|
||||
}
|
||||
if obj.Attributes.Link != nil {
|
||||
shape.Link = obj.Attributes.Link.Value
|
||||
}
|
||||
shape.Icon = obj.Attributes.Icon
|
||||
if obj.IconPosition != nil {
|
||||
shape.IconPosition = *obj.IconPosition
|
||||
|
|
@ -232,7 +236,9 @@ func toConnection(edge *d2graph.Edge, theme *d2themes.Theme) d2target.Connection
|
|||
connection.Animated, _ = strconv.ParseBool(edge.Attributes.Style.Animated.Value)
|
||||
}
|
||||
|
||||
connection.Tooltip = edge.Attributes.Tooltip
|
||||
if edge.Attributes.Tooltip != nil {
|
||||
connection.Tooltip = edge.Attributes.Tooltip.Value
|
||||
}
|
||||
connection.Icon = edge.Attributes.Icon
|
||||
|
||||
if edge.Attributes.Style.Italic != nil {
|
||||
|
|
|
|||
4
testdata/d2compiler/TestCompile/path_link.exp.json
generated
vendored
4
testdata/d2compiler/TestCompile/path_link.exp.json
generated
vendored
|
|
@ -129,7 +129,9 @@
|
|||
"value": "x"
|
||||
},
|
||||
"style": {},
|
||||
"link": "Overview.Untitled board 7.zzzzz",
|
||||
"link": {
|
||||
"value": "Overview.Untitled board 7.zzzzz"
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
|
|
|
|||
4
testdata/d2compiler/TestCompile/url_link.exp.json
generated
vendored
4
testdata/d2compiler/TestCompile/url_link.exp.json
generated
vendored
|
|
@ -129,7 +129,9 @@
|
|||
"value": "x"
|
||||
},
|
||||
"style": {},
|
||||
"link": "https://google.com",
|
||||
"link": {
|
||||
"value": "https://google.com"
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
|
|
|
|||
Loading…
Reference in a new issue