Comments (5)
This is related to the internal usage of cheerio to replace the pictures and the configuration I pass: https://github.com/axe312ger/metalsmith-adaptive-images/blob/master/src/index.js#L104-L106
I had to do this to get valid HTML back then in the project I developed this for.
If anybody has a replacement for cheerio which will NOT alter the html code besides the image replacement, I'd be super happy to merge this is. A simple regex is IMHO not reliable enough.
from metalsmith-adaptive-images.
Can you maybe try to remove the xmlMode: true
and see if it is working properly for you? That might be a quick fix.
from metalsmith-adaptive-images.
As described here non-safe solution could be like this:
file.contents = new Buffer($.html({ decodeEntities: false }));
It works fine for me.
from metalsmith-adaptive-images.
Yeah we can't do that :/
var cheerio = require("cheerio")
const $ = cheerio.load('<div><script>alert('xss')</script></div>')
console.log($.html())
// "<div><script>alert('xss')</script></div>"
console.log($.html({decodeEntities: false}))
// "<div><script>alert('xss')</script></div>"
from metalsmith-adaptive-images.
Thank you anyways
from metalsmith-adaptive-images.
Related Issues (14)
- An in-range update of babel-core is breaking the build 🚨 HOT 1
- An in-range update of babel-plugin-istanbul is breaking the build 🚨 HOT 2
- An in-range update of eslint-plugin-babel is breaking the build 🚨 HOT 5
- An in-range update of babel-plugin-transform-object-rest-spread is breaking the build 🚨 HOT 1
- An in-range update of babel-register is breaking the build 🚨 HOT 1
- An in-range update of eslint-plugin-promise is breaking the build 🚨 HOT 4
- An in-range update of cz-conventional-changelog is breaking the build 🚨 HOT 1
- An in-range update of eslint is breaking the build 🚨 HOT 5
- Support for lazy load HOT 1
- Provide a concrete example to understand how your plugin works? HOT 1
- Metalsmith CLI integration HOT 1
- Plugin deprecation: Looking for new maintainer(s)!
- An in-range update of cross-env is breaking the build 🚨 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metalsmith-adaptive-images.