#374·defuddle

broken wikipedia image links

Author: bovine3domCreated Aug 30, 2026Updated Sep 4, 2026

hello

defuddle takes

xml
<img
  resource="https://en.wikipedia.org/wiki/File:German_Wacht_Am_Rhein_Offensive_Plan.png"
  src="//upload.wikimedia.org/wikipedia/commons/thumb/6/65/German_Wacht_Am_Rhein_Offensive_Plan.png/500px-German_Wacht_Am_Rhein_Offensive_Plan.png"
  loading="lazy">

and makes

<img src="https://en.wikipedia.org/wiki/File:German_Wacht_Am_Rhein_Offensive_Plan.png">

which doesn't work, because that's a page and not an image.

it seems to me like you're sniffing all the attributes here https://github.com/kepano/defuddle/blob/197db78742ad0fb91100c2b478f5350ee9d8702c/src/elements/images.ts#L170 and assuming that anything that ends in an image file extension is an image. is there a good reason to not use src= preferentially if it exists? https://github.com/kepano/defuddle/pull/32 doesn't shed much light on the why

thanks! :)