Description
If an image link includes an optional title, mdview treats the title as part of the file path. The image then fails to load.
CommonMark allows a title after the image destination:

Steps to reproduce
-
Create docs/images/diagram.png.
-
Create docs/example.md with this content:
# Example

-
Run mdview docs/example.md.
Expected behavior
mdview resolves the path docs/images/diagram.png and shows the image. The title becomes the image's title attribute.
Actual behavior
mdview prints a warning, and the image does not show:
Warning: Unable to stat image file /path/to/docs/images/diagram.png "Architecture diagram": stat /path/to/docs/images/diagram.png "Architecture diagram": no such file or directory
The quoted title is included in the path that mdview tries to stat.
If the title is removed (), the image shows correctly.
Environment
Description
If an image link includes an optional title, mdview treats the title as part of the file path. The image then fails to load.
CommonMark allows a title after the image destination:
Steps to reproduce
Create
docs/images/diagram.png.Create
docs/example.mdwith this content:Run
mdview docs/example.md.Expected behavior
mdview resolves the path
docs/images/diagram.pngand shows the image. The title becomes the image'stitleattribute.Actual behavior
mdview prints a warning, and the image does not show:
The quoted title is included in the path that mdview tries to stat.
If the title is removed (
), the image shows correctly.Environment