From c31cf16ef9f1fff988e8925ce2336d73244b2797 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Thu, 8 Sep 2022 00:01:09 +0200 Subject: [PATCH] Fix support for hex runes. --- convert.go | 2 +- convert_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/convert.go b/convert.go index a31933c..6dfa79b 100644 --- a/convert.go +++ b/convert.go @@ -480,7 +480,7 @@ func (bordertype) parse(input []byte, first int) (pos int, val reflect.Value, er // "\xFF" - a hex-encoded ascii value // "\u1234" - a hex-encoded rune // "\U12345678" - a hex-encoded rune -var reBorderStr = `"(?:\\[\\"]|\\[0-7]{3}|\\x[0-9a-fA-F]{2}|\\u[0-9]{4}|\\U[0-9]{8}|[^\\"])*"` +var reBorderStr = `"(?:\\[\\"]|\\[0-7]{3}|\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\"])*"` var reBorder = regexp.MustCompile(`^\s*(?:border\s*\(\s*(` + reBorderStr + `)\s*,\s*(` + diff --git a/convert_test.go b/convert_test.go index 74713be..d7b88a5 100644 --- a/convert_test.go +++ b/convert_test.go @@ -75,8 +75,8 @@ margin-top: 10;`, ``}, `border-style: border("a","b","c","d","e","f","g","h")`, `border-style: border("a","b","c","d","e","f","g","h");`, ``}, {emptyStyle, - `border-style: border("\"","\x41","\102","\u0041","\U00000041","abc","a\"b","\\")`, - `border-style: border("\"","A","B","A","A","abc","a\"b","\\");`, ``}, + `border-style: border("\"","\x41","\102","\u004a","\U0000004a","abc","a\"b","\\")`, + `border-style: border("\"","A","B","J","J","abc","a\"b","\\");`, ``}, {emptyStyle, `border: border("a","b","c","d","e","f","g","h") true false`, `border-bottom: true;