Skip to content

Commit

Permalink
refactor template parser
Browse files Browse the repository at this point in the history
yosida95 committed Nov 17, 2020
1 parent b08c3d0 commit 2cf536b
Showing 2 changed files with 151 additions and 226 deletions.
13 changes: 13 additions & 0 deletions escape.go
Original file line number Diff line number Diff line change
@@ -104,6 +104,19 @@ func unhex(c byte) byte {
return 0
}

func ishex(c byte) bool {
switch {
case '0' <= c && c <= '9':
return true
case 'a' <= c && c <= 'f':
return true
case 'A' <= c && c <= 'F':
return true
default:
return false
}
}

func pctDecode(s string) string {
size := len(s)
for i := 0; i < len(s); {
Loading

0 comments on commit 2cf536b

Please sign in to comment.