check root another way

This commit is contained in:
Alexander Wang 2023-02-09 19:02:21 -08:00
parent 0e7b05650a
commit ef1dc4612d
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
2 changed files with 5 additions and 1 deletions

View file

@ -169,6 +169,10 @@ func testPinned(t *testing.T, outDir string) {
name: "orientation",
text: "a: {\n b\n c\n }\n a <- a.c\n a.b -> a\n",
},
{
name: "cannot create edge between boards",
text: `"" <-> ""`,
},
}
for _, tc := range testCases {

View file

@ -233,7 +233,7 @@ func NodeBoardKind(n Node) BoardKind {
var f *Field
switch n := n.(type) {
case *Field:
if n.Name == "" {
if n.parent == nil {
return BoardLayer
}
f = ParentField(n)