Skip to content

Commit

Permalink
chore: simplfy nested loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ycd committed Jan 24, 2021
1 parent 421ff18 commit b933052
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/toc/toc.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ func getHeaderValue(header string) int {

func (t *toc) getDelimiter(header int) string {
// Set delimiter
if t.Options.Bulleted == true {
if header >= 1 {
return "*"
}
return "-"
if t.Options.Bulleted != true {
return "1."
}

if header >= 1 {
return "*"
}
return "1."

return "-"
}

func (t *toc) parseHTML(body []byte) error {
Expand Down

0 comments on commit b933052

Please sign in to comment.