Closed brian428 closed 8 years ago
Thank you for your report! I've fixed a similar issue in master. Could you please test the current master if it still fails in your case?
@brian428, can you please try out the 3.x.x series of preprocess
and report whether you're still having issues?
Will do! I'll try to replicate the problem I was having and let you know how it goes.
I'm running into the same problem that was brought up in issue #46, but for an exclude test. I commented on that issue (https://github.com/jsoverson/preprocess/issues/46#issuecomment-81703776) but haven't seen any responses, so maybe no one is getting notified since the issue is closed?
I'm running a project that appears to end up passing a test string containing only a new line. I'm on Windows, so I think this is coming through as "\r\n". I'm not sure if something outside of preprocess.js is passing something it really shouldn't be, or if it's a result of the regex replacement that happens earlier in the script.
Either way, this blows up in getTestTemplate(). I was able to prevent it by adding a line at the top of testPasses() that contains:
if( test && test.replace( /[\n\r\s]*/gi, '' ) == '' ) { test = '' }
. (Obviously, this is just saying "after replacing all spaces, cr, and lf, if we're left with an empty string, then set test to an empty string").I don't understand everything going on in preprocess.js well enough to know if this is a truly viable fix, but for now it's what I'm using to stop it from failing.