Dmitriy Pleshevskiy
2b3fe47333
- d2/patches: expose autoformat subcommand - d2/patches: update self referencing connection to latest master
25 lines
608 B
Diff
25 lines
608 B
Diff
diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go
|
|
index 5e3f5e5..c2d5511 100644
|
|
--- a/d2graph/d2graph.go
|
|
+++ b/d2graph/d2graph.go
|
|
@@ -721,20 +721,16 @@ func (obj *Object) Connect(srcID, dstID []string, srcArrow, dstArrow bool, label
|
|
return nil, errors.New("cannot connect to reserved keyword")
|
|
}
|
|
}
|
|
}
|
|
|
|
src := srcObj.EnsureChild(srcID)
|
|
dst := dstObj.EnsureChild(dstID)
|
|
|
|
- if src == dst {
|
|
- return nil, errors.New("self-referencing connection")
|
|
- }
|
|
-
|
|
edge := &Edge{
|
|
Attributes: Attributes{
|
|
Label: Scalar{
|
|
Value: label,
|
|
},
|
|
},
|
|
Src: src,
|
|
SrcArrow: srcArrow,
|