From ef6ccdd1945251351784f24a63e708177db3d714 Mon Sep 17 00:00:00 2001 From: Mrinal Wadhwa Date: Fri, 9 Nov 2018 15:54:10 -0800 Subject: [PATCH] fix: escape % in formatted errors --- did.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/did.go b/did.go index d043023..acc41b0 100644 --- a/did.go +++ b/did.go @@ -316,7 +316,7 @@ func (p *parser) parsePath() parserStep { if (currentIndex+2 >= inputLength) || isNotHexDigit(input[currentIndex+1]) || isNotHexDigit(input[currentIndex+2]) { - return p.errorf(currentIndex, "% is not followed by 2 hex digits") + return p.errorf(currentIndex, "%% is not followed by 2 hex digits") } // if we got here, we're dealing with percent encoded char, jump three chars percentEncoded = true @@ -382,7 +382,7 @@ func (p *parser) parseFragment() parserStep { if (currentIndex+2 >= inputLength) || isNotHexDigit(input[currentIndex+1]) || isNotHexDigit(input[currentIndex+2]) { - return p.errorf(currentIndex, "% is not followed by 2 hex digits") + return p.errorf(currentIndex, "%% is not followed by 2 hex digits") } // if we got here, we're dealing with percent encoded char, jump three chars percentEncoded = true