diff --git a/index.js b/index.js index 8cc27f6..a0a1114 100644 --- a/index.js +++ b/index.js @@ -76,7 +76,6 @@ module.exports = async (html, options) => { }); /* head */ - $('*').removeAttr('style'); /* main amp library */ @@ -171,6 +170,11 @@ module.exports = async (html, options) => { } }); + /* img layout */ + $('img').each((_, element) => { + $(element).attr({ layout: 'responsive' }); + }); + /* inline styles */ let inlineCss = ''; diff --git a/test/images.test.js b/test/images.test.js index 8a46c93..00c23b6 100644 --- a/test/images.test.js +++ b/test/images.test.js @@ -5,7 +5,7 @@ describe('amp-img tag', () => { test('should replace img tag with amp-img', () => { assert( '', - '
1
2
1
2
1
2