Skip to content

Commit

Permalink
#133 idk if it breaks html parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarnathCJD committed Aug 9, 2024
1 parent e8cca2b commit f1072cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion telegram/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func getTextLength(n *html.Node) int32 {
currentNode := n.FirstChild
for currentNode != nil {
if currentNode.Type == html.TextNode {
tagLength += utf16RuneCountInString(currentNode.Data)
tagLength += utf16RuneCountInString(strings.TrimSpace(currentNode.Data))
} else if currentNode.Type == html.ElementNode {
tagLength += getTextLength(currentNode)
}
Expand Down
2 changes: 1 addition & 1 deletion telegram/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func (c *Client) runFilterChain(m *NewMessage, filters []Filter) bool {
}
)

if filters != nil && len(filters) > 0 {
if len(filters) > 0 {
for _, filter := range filters {
if filter.Private && !m.IsPrivate() || filter.Group && !m.IsGroup() || filter.Channel && !m.IsChannel() {
return false
Expand Down

0 comments on commit f1072cf

Please sign in to comment.