mirror of
https://github.com/fluffle/goirc
synced 2025-05-21 23:13:20 +00:00
Parse <sup> as ^ in calc
This commit is contained in:
parent
fb694f1546
commit
99d1d42a0a
1 changed files with 5 additions and 2 deletions
|
@ -158,11 +158,14 @@ func calc(conn *irc.Conn, nick *irc.Nick, args, target string) {
|
|||
}
|
||||
|
||||
func parseCalc(output string) string {
|
||||
unquote, err := strconv.Unquote(output)
|
||||
parsed, err := strconv.Unquote(output)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return html.UnescapeString(unquote)
|
||||
parsed = html.UnescapeString(parsed)
|
||||
parsed = strings.Replace(parsed, "<sup>", "^(", -1)
|
||||
parsed = strings.Replace(parsed, "</sup>", ")", -1)
|
||||
return parsed
|
||||
}
|
||||
|
||||
// please disregard the reproduction of src/pkg/http/client.go:send below
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue