Skip to content

Commit

Permalink
Save full response from GH if --debug is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Nov 29, 2020
1 parent 502a254 commit bed9343
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ghdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ func (doc *GHDoc) Convert2HTML() error {
if err != nil {
return err
}
// doc.d("Convert2HTML: " + htmlBody)
if doc.Debug {
htmlFile := doc.Path + ".debug.html"
doc.d("Convert2HTML: write html file: " + htmlFile)
ioutil.WriteFile(htmlFile, []byte(htmlBody), 0644)
}
doc.html = htmlBody
return nil
}
Expand Down Expand Up @@ -124,7 +128,7 @@ func (doc *GHDoc) GrabToc() *GHToc {
if i == 0 || name == "" {
continue
}
doc.d("GrabToc: process group: " + name + " ...")
doc.d("GrabToc: process group: " + name + ": " + match[i] + " ...")
group[name] = removeStuf(match[i])
}
// update minimum header number
Expand All @@ -144,7 +148,7 @@ func (doc *GHDoc) GrabToc() *GHToc {
continue
}

link := group["href"]
link, _ := url.QueryUnescape(group["href"])
if doc.AbsPaths {
link = doc.Path + link
}
Expand Down

0 comments on commit bed9343

Please sign in to comment.