From 5da221af994da6807c1b23486c71cf434874da0b Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Thu, 25 Oct 2018 12:00:36 +0200 Subject: [PATCH] Fix ignore chars regex flags in rainbow example Use global matches rather than stopping after the first match --- examples/rainbow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rainbow.js b/examples/rainbow.js index a4a2e0a..fc086fa 100644 --- a/examples/rainbow.js +++ b/examples/rainbow.js @@ -1,7 +1,7 @@ 'use strict'; const chalk = require('..'); -const ignoreChars = /[^!-~]/; +const ignoreChars = /[^!-~]/g; function rainbow(str, offset) { if (!str || str.length === 0) {