S
S
Sergey2018-04-23 22:18:25
HTML
Sergey, 2018-04-23 22:18:25

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&#32;

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 question

Ask a Question

731 491 924 answers to any question