Parent of the first block has an empty style

This commit is contained in:
Christian Muehlhaeuser
2019-12-08 16:47:11 +01:00
parent 15370d018f
commit bdc418e334
+4 -2
View File
@@ -63,8 +63,10 @@ func (s BlockStack) Width(ctx RenderContext) uint {
}
func (s BlockStack) Parent() BlockElement {
if len(s) < 2 {
return s.Current()
if len(s) == 1 {
return BlockElement{
Block: &bytes.Buffer{},
}
}
return s[len(s)-2]