README documentation - first example - image.png needs to be image.jpg
In the first example, for file.html:
<img src="image.png" data-src="image2x.png" >
When it should be
<img src="image.jpg" data-src="image2x.png" >
As a beginner to understanding loaders, this slight typo really threw me off. :)
Hi, seems to be my bad here, but can you explain little more detailed what threw off please :)
From the README doc:
<!-- file.html -->
<img src="image.png" data-src="image2x.png" >
Notice the src attribute points to image.png. I believe it should point to image.jpg because ... In the proceeding example:
require("html!./file.html");
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg"
// data-src="image2x.png">'
The src attribute is updated accordingly, and it has a jpg extension. That's what threw me off, because originally it had a png extension.
kk 👍 i will make the examples consistent
Hi,
I believe that only the compiled example should be changed since after this instance in the code it clearly always references png extension with the same hash (a992ca).
<!-- file.html -->
<img src="image.png" data-src="image2x.png" >
require("html!./file.html");
// => '<img src="http://cdn.example.com/49eba9f/a992ca.jpg" /* Error is here */
// data-src="image2x.png">'
require("html?attrs=img:data-src!./file.html");
// => '<img src="image.png" data-src="data:image/png;base64,..." >'
require("html?attrs=img:src img:data-src!./file.html");
require("html?attrs[]=img:src&attrs[]=img:data-src!./file.html");
// => '<img src="http://cdn.example.com/49eba9f/a992ca.png"
// data-src="data:image/png;base64,..." >'
I've made the changes in #86 if that's ok with you @michael-ciniawsky.
Pulled it in, LGTM, let me know if any others changes.
@andreicek thx 👍