Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch html2amp@1.4.2 for the project I'm working on.
I don't think it's a perfect solution but it might help someone else.
Here is the diff that solved my problem:
diff --git a/node_modules/html2amp/lib/utils.js b/node_modules/html2amp/lib/utils.js
index e17e685..a67a513 100644
--- a/node_modules/html2amp/lib/utils.js
+++ b/node_modules/html2amp/lib/utils.js
@@ -51,7 +51,7 @@ const normalizeSrc = (src, srcset) => {
const remoteImgCaches = new Map()
const srcNode = async (cwd, attributes) => {
const { src, alt = '', ...attrs } = attributes
- const url = normalizeUrl(normalizeSrc(src, attributes.srcset))
+ const url = normalizeUrl(normalizeSrc(src, attributes.srcset || attributes['data-srcset']))
let size = { width: null, height: null }
let result = null
if (url.startsWith('http')) {
This issue body was partially generated by patch-package.
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
html2amp@1.4.2for the project I'm working on.I don't think it's a perfect solution but it might help someone else.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.