markdownlint
markdownlint copied to clipboard
Add rule for image without line break
Description
Often users want images to be displayed on a separate line. They then add a single line break and then the image reference, e.g.:
some text
[My image](image.png)
However, due to Markdown line break handling, this will actually be considered an image which is on the same line as the text. In most cases this renders as desired, but only because Markdown renderer tend to wrap images to the next line if there is not enough space. Viewing the Markdown file on a page with a different width or with a different screen size can suddenly show the image on the same line.
It might therefore be good to flag image references, which follow a non-empty line without a hard line break (e.g. trailing 2 spaces or trailing \
).
Though, maybe there are corner cases where such behavior is desired.
Example
Test:

(Have included this as screenshot because GitHub Markdown does not require trailing 2 spaces for line breaks.)
I would also like to have this feature. I cannot find it in the current version as of today. Thanks.