Skip to content

Commit

Permalink
Fix support for hex runes.
Browse files Browse the repository at this point in the history
  • Loading branch information
knz committed Sep 7, 2022
1 parent fb8cd90 commit c31cf16
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion convert.go
Original file line number Diff line number Diff line change
@@ -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*(` +
4 changes: 2 additions & 2 deletions convert_test.go
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit c31cf16

Please sign in to comment.