I am trying to search and replace an image with Cloudflare workers. I figured out that I propably have to use the HTMLRewriter, however so far I did not manage to get it working at all. Maybe someone in the Cloudflare Community got an idea.
So here is what I want to replace (somwhere in my HTML):
<img src="software/html5/imgs/topmenu/test1.ico" alt="Test1">
And I want to replace it with e.g.:
<img src="https://cdn4.iconfinder.com/data/icons/32x32-free-design-icons/32/Info.png" alt="Test1">
However when alt=“Test2” I do not want to replace anything. I only want to replace it when alt=“Test3”.
Thank you all very much!