markdown_articles_tool
markdown_articles_tool copied to clipboard
Image download is skipped when using md image size syntax
Hello
Following the 0.1.2 update, I have noticed that some images were not downloaded. It comes from the fact that in Markdown, you can specify an image width or height by adding " =WIDTHxHEIGHT". But when trying to download the image, the tool includes this information in the image URL. For instance, if a markdown file contains
My avatar scaled to 300 pixels width: ![](https://avatars.githubusercontent.com/u/32387838 =300x)
the tool will try to download the image at
https://avatars.githubusercontent.com/u/32387838 =300x
which is an invalid URL. Thus, the error message for unrecognized MIME type will be printed, and the download will be skipped.
Notes:
- This syntax is not recognized by every md parser, but it works on CodiMD.
- A link may still be valid if a query is used in the URL, as =300x will be considered a parameter. For example,
https://avatars.githubusercontent.com/u/32387838?s=80&v=4 =300x
is a valid URL - I found ths syntax described in this StackOverflow answer: https://stackoverflow.com/a/21242579
Wow. Is it syntax standard for Markdown? Previously, I did not pay attention to such things...
This is supported by the several editors...
Ok, I'll try to support this.