bedeoverend / gulp-process-inline

Gulp plugin to extract and restore partials from HTML files
3 stars 0 forks source link

Gulp process inline should not decode entities #4

Closed madeleineostoja closed 6 years ago

madeleineostoja commented 6 years ago

Running gulp-process-inline on a HTML file decodes all special characters as a HTML entity. This is usually fine if the HTML file is just plain markup, but it breaks templating (for example).

AFAIK this behaviour is an opinionated default from Cheerio, and can be disabled by passing { decodeEntities: false }, see https://github.com/cheeriojs/cheerio/issues/319

madeleineostoja commented 6 years ago

Since Cheerio options can only be passed on .load or .html (rather than on require), how would you feel about making opts.cheerio an options block that is passed to those methods, rather than the cheerio instance itself?

bedeoverend commented 6 years ago

Ah good pickup! Yup happy to do this. It'll remove ability to pass your own version of Cheerio, but I don't think that's a big issue