felixSchl/neodoc

Ignore colors in the parser

matthewmueller opened this issue · 3 comments

First of all this is a really excellent library. I've been waiting awhile for a proper docopt parser for JS. Great work!

One thing I did run into was that it's not possible to fully color some of the key commands. For example, if I want to color Usage:

This works

${chalk.blue('I. Usage')}:

This doesn't work:

${chalk.blue('I. Usage:')}

It's quite minor, but I'd love for this parser to just ignore the color codes altogether.

Wow yeah, good find and thanks for reporting. I can see how that would be an issue. Won't take long to fix I think.

I've got a fix implemented. These tests show what is now allowed: ffa7424#diff-846cfe57c9231ae390e1f48b1aeaacb2R913. That should cover your usecase but if you'd like to give me a fixture we can add that to the testbed and verify.

Github was a bit eager to close this because of the subject line. The fix is on development now and will be part of the next release. It's working fine for the fixture you have given me for #71 which includes colors as well. I updated the test suite accordingly. I think once we have #71 sorted out, I'll do a patch release. I've got some other fixes pending as well.