claudetech / node-static-i18n

HTML static pages i18n tool
https://www.npmjs.com/package/static-i18n
MIT License
102 stars 21 forks source link

Style urls aren't modified #38

Closed adrienluitot closed 4 years ago

adrienluitot commented 4 years ago

Hello,

The urls in style elements aren't change, for example if I have : <div style="background-image: url('assets/images/my_image.jpg');"></div> It stays like this in sub folders instead of being : <div style="background-image: url('../assets/images/my_image.jpg');"></div>

danhper commented 4 years ago

Hi and thanks for reporting this. Indeed, I think I forgot to add this logic. Would you have time to submit a PR for this, please? I would be more than happy to merge it! I guess that the proper way to do this would be to use a CSS parser and modify the AST but I am not sure it is worth the trouble, given the nature of this tool, so I think regexp replacement would be just fine. Thanks a lot!

adrienluitot commented 4 years ago

Hi

Woaw, I didn't take a deep look into the code but I'm not sure I could do that. x) If you don't have the time I might take a deeper look. ;)

And I think it might be really easy with regexp because it's, I think, always inside url(...).

danhper commented 4 years ago

I won't have time right now so if you have a moment it would be great if you could give it a shot. Thanks a lot!

adrienluitot commented 4 years ago

Okay, I'll try to take a look ;)