79610477

Date: 2025-05-07 12:12:51
Score: 0.5
Natty:
Report link

Most of the code is fine, the only thing missing is just a single quotation mark:

html`<img
    // ...
    src='${selectedImagePath}'
  >`

Why? Because your image path contains spaces:

{ 
  "paths": "img/Acer platanoides - spisslønn - Ak, Follo, Ås - mai 2014.JPG"
}

When the full image path is not enclosed in quotation marks, it looks like this:

html`<img
    // ...
    src=img/Acer platanoides - spisslønn - Ak, Follo, Ås - mai 2014.JPG
  >`

When this HTML string is rendered as a DOM, you will find that all characters after the first space in the src are not included in the src attribute, but are instead parsed as custom attributes:

<img
  // ... 
  src="img/Acer" platanoides="" -="" spisslønn="" ak,="" follo,="" Ås="" mai="" 2014.jpg="" alt="Selected image">

So you just need add a single quotation.

Reasons:
  • Blacklisted phrase (0.5): Why?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: yuanyxh