From b827cb081792c04212284c93bb07bd5c758bab05 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Sat, 27 Oct 2018 16:09:54 +0200 Subject: [PATCH] Fix ignore chars regex flags in rainbow example (#306) 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) {