Split container/text HTML entities and add support for <hr>

This commit is contained in:
Tulir Asokan
2019-04-10 22:49:33 +03:00
parent db0e24ccc2
commit a9199dd9f2
11 changed files with 467 additions and 327 deletions

View File

@@ -22,15 +22,17 @@ import (
)
type CodeBlockEntity struct {
*BaseEntity
*ContainerEntity
Background tcell.Style
}
func NewCodeBlockEntity(children []Entity, background tcell.Style) *CodeBlockEntity {
return &CodeBlockEntity{
BaseEntity: &BaseEntity{
Tag: "pre",
Block: true,
ContainerEntity: &ContainerEntity{
BaseEntity: &BaseEntity{
Tag: "pre",
Block: true,
},
Children: children,
},
Background: background,
@@ -39,8 +41,8 @@ func NewCodeBlockEntity(children []Entity, background tcell.Style) *CodeBlockEnt
func (ce *CodeBlockEntity) Clone() Entity {
return &CodeBlockEntity{
BaseEntity: ce.BaseEntity.Clone().(*BaseEntity),
Background: ce.Background,
ContainerEntity: ce.ContainerEntity.Clone().(*ContainerEntity),
Background: ce.Background,
}
}