aboutsummaryrefslogtreecommitdiff
path: root/ui/messages/parser
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-07 18:21:38 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-07 18:21:38 +0300
commitb0c4ef81e9a1c7d9376685875d795ad3b5d8db01 (patch)
tree57f4ffa5957fa89aa1b65927b0259c7eb6965959 /ui/messages/parser
parent21b81ccb2716d73cde4eda805cf1f5ea1642412e (diff)
More changes to do #91
Diffstat (limited to 'ui/messages/parser')
-rw-r--r--ui/messages/parser/htmlparser.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/messages/parser/htmlparser.go b/ui/messages/parser/htmlparser.go
index 3d1548b..9a9c2d1 100644
--- a/ui/messages/parser/htmlparser.go
+++ b/ui/messages/parser/htmlparser.go
@@ -266,6 +266,9 @@ func (parser *htmlParser) singleNodeToEntity(node *html.Node, stripLinebreak boo
case html.ElementNode:
return parser.tagNodeToEntity(node, stripLinebreak)
case html.DocumentNode:
+ if node.FirstChild.Data == "html" && node.FirstChild.NextSibling == nil {
+ return parser.singleNodeToEntity(node.FirstChild, stripLinebreak)
+ }
return &messages.HTMLEntity{
Tag: "html",
Children: parser.nodeToEntities(node.FirstChild, stripLinebreak),