Skip to content

Commit

Permalink
Merge pull request #14 from PokeGuys/hotfix/unescape-json-html-entity
Browse files Browse the repository at this point in the history
fix: unescape html entity in json encoder
  • Loading branch information
PokeGuys authored Aug 6, 2024
2 parents 7c2770a + b07f522 commit b8ddfec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/crawler/crawler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"bytes"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -36,11 +37,13 @@ func main() {

// Print the results in JSON format
if cfg.PrintJSON {
b, err := json.Marshal(apk)
if err != nil {
enc := json.NewEncoder(os.Stdout)
buf := new(bytes.Buffer)
enc.SetEscapeHTML(false)
if err := enc.Encode(apk); err != nil {
log.Fatal(err.Error())
}
fmt.Println(string(b))
fmt.Println(string(buf.Bytes()))
return
}

Expand Down

0 comments on commit b8ddfec

Please sign in to comment.