Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow providing an array of several values for start_comment and end_comment #11

Open
JacobDB opened this issue Jun 8, 2017 · 1 comment

Comments

@JacobDB
Copy link

JacobDB commented Jun 8, 2017

It'd be nice to be able to do something like this:

var stripCode = require('gulp-strip-code');
 
gulp.task('templates', function(){
  gulp.src(['file.txt'])
    .pipe(stripCode({
      start_comment: ["<!--start-test-block-->", "/*start-test-block*/", "//start-test-block"],
      end_comment: ["<!--end-test-block-->", "/*end-test-block*/", "//end-test-block"]
    }))
    .pipe(gulp.dest('build/file.txt'));
});

In order to parse multiple types of files in one go.

@JacobDB
Copy link
Author

JacobDB commented Jun 8, 2017

Alternatively, providing a regular expression for these values could work too. Along the lines of:

var stripCode = require('gulp-strip-code');
 
gulp.task('templates', function(){
  gulp.src(['file.txt'])
    .pipe(stripCode({
      start_comment: "/(?:<!--|\/\*|\/\/)start-test-block(?:-->|\*\/)?/g",
      end_comment: "/(?:<!--|\/\*|\/\/)end-test-block(?:-->|\*\/)?/g"
    }))
    .pipe(gulp.dest('build/file.txt'));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant