mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Fix parsing ordered lists that start at zero
Backported from 28fbb3851d
This commit is contained in:
parent
420b8201ac
commit
0d23249f92
2 changed files with 7 additions and 2 deletions
|
|
@ -71,8 +71,13 @@ func (parser *HTMLParser) getAttribute(node *html.Node, attribute string) string
|
|||
return ""
|
||||
}
|
||||
|
||||
// Digits counts the number of digits in a non-negative integer.
|
||||
// Digits counts the number of digits (and the sign, if negative) in an integer.
|
||||
func Digits(num int) int {
|
||||
if num == 0 {
|
||||
return 1
|
||||
} else if num < 0 {
|
||||
return Digits(-num) + 1
|
||||
}
|
||||
return int(math.Floor(math.Log10(float64(num))) + 1)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
package mautrix
|
||||
|
||||
const Version = "v0.11.0"
|
||||
const Version = "v0.11.1"
|
||||
|
||||
var DefaultUserAgent = "mautrix-go/" + Version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue