Hierarchical crack patterns: a comparison with two-dimensional soap foams