Full number AltText recognized as image width, is that normal?

Steps to reproduce

Insert a picture using standard syntax and set the AltText to full number: ![01](assets/image.gif)

Expected result

The picture should have normal size.

Actual result

The number in the name is recognized as image width.

(I thought only the number after the | represents the size of the image, like this [xxx|1280](assets/image.gif), but now without the |, the full number AltText is also recognized as size, does this normal?

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.12.4

Additional information

Hi @HaujetZhao, it seems that when a number appears between the square brackets of an embedded image, Obsidian uses it to define the image width.

None of the markdown standards I’ve seen details this behavior, neither Obsdian help Format your notes

If you need to use a number as an alt text (it’s rare), maybe you can write it between single/double quotes… it just needs to contain a non-number character to be considered as an alt text.

These are shown with a 100px width

![100](../attachments/The-Homer-car.jpg)

![Homer|100](../attachments/The-Homer-car.jpg)

This is shown without specifying an image width

!["100"](../attachments/The-Homer-car.jpg)

I don’t have that urgent need. It’s just accidentally I found this strange behavior, and did a report.

Steps to reproduce

Insert an image using Markdown link with an digital alt text 20221028124042:

![20221028124042](https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.rd.com%2Flist%2Fblack-cat-breeds%2F&psig=AOvVaw3i_mF3VlTKGwLXuWxjeXCO&ust=1667061567630000&source=images&cd=vfe&ved=0CAwQjRxqFwoTCNj9pbaug_sCFQAAAAAdAAAAABAE)

Expected result

Since it is not in the form ![alt|100x100](url), the alt text should not be recognized as rescaling values.

Actual result

Obsidian recognizes the digital alt text as rescaling values, and makes the image “infinitely” large, crashing the app.

Environment

  • Operating system: macOS
  • Obsidian version: v1.0.3