mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #474] Add rule for image without line break #2237
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Marcono1234 on GitHub (Dec 29, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/474
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.:
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
(Have included this as screenshot because GitHub Markdown does not require trailing 2 spaces for line breaks.)
@miu007 commented on GitHub (Oct 10, 2023):
I would also like to have this feature. I cannot find it in the current version as of today. Thanks.