gulp-html-replace icon indicating copy to clipboard operation
gulp-html-replace copied to clipboard

newline under comment block inserted with keepBlockTags: true

Open sonicblis opened this issue 9 years ago • 0 comments

In Jetbrains IDE WebStorm, replacing content and keeping the blocks seems to add a newline under the blocks when the content is changed.

gulp.task('prodBaseUrl', function(){
    gulp.src('index.html')
        .pipe(htmlReplace(
            {
                base:{
                    src: 'https://myprodurl.com/index.html',
                    tpl: '<base href="%s" />'
                }
            },
            {
                keepBlockTags: true
            })
        )
        .pipe(gulp.dest('./'));
});

after a couple of transformations, my index.html goes from this

<!-- build:base -->
<base href="https://myprodurl.com/index.html" />
<!-- endbuild -->

<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans' type='text/css'>

to this

<!-- build:base -->
<base href="https://myprodurl.com/index.html" />
<!-- endbuild -->



<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans' type='text/css'>

sonicblis avatar Dec 15 '15 16:12 sonicblis