Giter Club home page Giter Club logo

Comments (6)

michael-ciniawsky avatar michael-ciniawsky commented on June 16, 2024

Hi, seems to be my bad here, but can you explain little more detailed what threw off please :)

from html-loader.

wittibs avatar wittibs commented on June 16, 2024

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.

from html-loader.

michael-ciniawsky avatar michael-ciniawsky commented on June 16, 2024

kk πŸ‘ i will make the examples consistent

from html-loader.

andreicek avatar andreicek commented on June 16, 2024

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.

from html-loader.

hemanth avatar hemanth commented on June 16, 2024

Pulled it in, LGTM, let me know if any others changes.

from html-loader.

michael-ciniawsky avatar michael-ciniawsky commented on June 16, 2024

@andreicek thx πŸ‘

from html-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.