gulp-preprocess icon indicating copy to clipboard operation
gulp-preprocess copied to clipboard

exec fails if parameter string contains a comma (,)

Open gchiappe opened this issue 6 years ago • 0 comments

This is my preprocess function:

.pipe(preproc({ context: {
          LOG: (themsg) => { return "console.log(`[DEBUG] " + themsg + "`);" }
      }}))

And this my source file:

// @exec LOG('Seguimiento2 versión ${this.VERSION} ©2019 GCA')

In browser, it should print in console:

[DEBUG] Seguimiento2 versión 2.0.1 ©2019 GCA

But when I add a comma like this:

// @exec LOG('Seguimiento2 , versión ${this.VERSION} ©2019 GCA')

Then the console output is the following:

[DEBUG] undefined

I think something is wrong with the @exec regex.

Also I think the bug is present in parent project jsoverson/preprocess.

gchiappe avatar Apr 09 '19 18:04 gchiappe