]> git.maquefel.me Git - brevno-suite/hugo/commit
tpl/compare: Sort special float values as string
authoracclassic <84147355+acclassic@users.noreply.github.com>
Mon, 2 Jan 2023 16:35:08 +0000 (17:35 +0100)
committerGitHub <noreply@github.com>
Mon, 2 Jan 2023 16:35:08 +0000 (17:35 +0100)
commitf95fd57aaccb999b6fefe7b2ac9239a6c3325b0f
tree535954d426e1730beaabf1ea36244163ac443d67
parente754d5cb3e6545ab5c21668a3e775ca5e9084761
tpl/compare: Sort special float values as string

When sorting strings a worng order is returned. This happens because the strings are first converted
to floating values to check whether or not they should be sorted as
floating values. When an error is returned the strings will be
handled as string literals.
No error will be returned when parsing Inf, Infinity or NaN (case insensitive) because they
will be coverted to special floating point values and therefore are
legal float values.
Now we check if the returned converted values are special floating
values and treat them as string literals.

Fixes #10389
.gitignore [deleted file]
tpl/compare/compare.go
tpl/compare/compare_test.go