Answer the question
In order to leave comments, you need to log in
Gluing words gulp minifyHTML?
I ran into a problem when minifying HTML, some words between which there are <br>
- in the mobile version we make it br { display: none }
. And instead Привет <br> мир!
, we get together Приветмир!
.
Someone faced? How to deal with, except for a visual check of all content and in places where it has merged, manually add a space like 
gulp.task('minifyHTML', function() {
return gulp.src(['src/**/*.html','src/**/*.php'])
.pipe(rev())
.pipe(htmlmin({
collapseWhitespace: true,
ignoreCustomFragments: [ /<%[\s\S]*?%>/, /<\?[=|php]?[\s\S]*?\?>/ ]
}))
.pipe(gulp.dest('dist'));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question