diff --git a/d2oracle/edit.go b/d2oracle/edit.go index 8813755bf..7bdb555f5 100644 --- a/d2oracle/edit.go +++ b/d2oracle/edit.go @@ -1864,6 +1864,12 @@ func DeleteIDDeltas(g *d2graph.Graph, key string) (deltas map[string]string, err conflictNewIDs := make(map[*d2graph.Object]string) conflictOldIDs := make(map[*d2graph.Object]string) if mk.Key != nil { + ida := d2graph.Key(mk.Key) + // Deleting a reserved field cannot possibly have any deltas + if _, ok := d2graph.ReservedKeywords[ida[len(ida)-1]]; ok { + return nil, nil + } + var ok bool obj, ok = g.Root.HasChild(d2graph.Key(mk.Key)) if !ok { diff --git a/d2oracle/edit_test.go b/d2oracle/edit_test.go index f6dc0cf3a..e51893812 100644 --- a/d2oracle/edit_test.go +++ b/d2oracle/edit_test.go @@ -4895,7 +4895,18 @@ x.y.z.w.e.p.l -> x.y.z.1.2.3.4 "x.x": "x" }`, }, + { + name: "nested-height", + text: `x: { + a -> b + height: 200 +} +`, + key: `x.height`, + + exp: `null`, + }, { name: "only-reserved", text: `guitar: {