Skip to content

Commit

Permalink
Merge pull request #23 from alessandrome/feature/color_insensitive_case
Browse files Browse the repository at this point in the history
Enhancement: Hex color now accept also lowercase values
  • Loading branch information
alessandrome committed Oct 14, 2019
2 parents 5af47d6 + da5f079 commit 25f8b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function testBgColor(color = bgColorDefault){
*/
function testColor(color) {
let result = false
let isAColor = /(^#[0-9A-F]{8}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{4}$)|(^#[0-9A-F]{3}$)/i.test(color)
let isAColor = /(^#[0-9a-zA-F]{8}$)|(^#[0-9a-zA-F]{6}$)|(^#[0-a-z9A-F]{4}$)|(^#[0-9a-zA-F]{3}$)/i.test(color)
let isAString = /^[a-zA-Z]+$/.test(color)
if(isAColor || isAString){
result = true
Expand Down

0 comments on commit 25f8b3f

Please sign in to comment.