Closed
Description
Hello, i was wondering if there is a way to remove html escaped characters while parsing a json as standard lib does. i can't find this in documentation.
package main
import (
"encoding/json"
"fmt"
"github.com/buger/jsonparser"
)
func main() {
e := []byte(`{ "url": "https:\/\/example.com\/" }`)
url, _, _, _ := jsonparser.Get(e, "url")
var parsed map[string]interface{}
json.Unmarshal(e, &parsed)
fmt.Println("with standard json:", parsed["url"].(string))
fmt.Println("with jsonparser:", string(url))
}
output
with standard json: https://example.com/
with jsonparser: https:\/\/example.com\/
Metadata
Metadata
Assignees
Labels
No labels