mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #827] MD034 false positive for HTML link with line break #542
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#542
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 @scottamain on GitHub (May 23, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/827
With
no-inline-html: false(MD033), I get a false positive forno-bare-urls(MD034) if there's a line break in the HTML tag. For example, if the HTML looks like this then MD034 flags it:But this is okay:
@DavidAnson commented on GitHub (May 23, 2023):
Your first example does not render as HTML according to the CommonMark specification, so the warning of a bare URL is correct.
https://markdown-it.github.io/#md3=%7B%22source%22%3A%22%3Ca%20class%3D%5C%22button%5C%22%20href%3D%5C%22https%3A%2F%2Fwww.example.com%5C%22%5Cn%3ESign%20up%3C%2Fa%3E%22%2C%22defaults%22%3A%7B%22html%22%3Atrue%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22src%22%7D%7D
@scottamain commented on GitHub (May 24, 2023):
That's interesting! Okay, although it's inconsistent with browser behavior, I can understand why MD parsers are more particular about where newlines appear inside a tag (it works if I put the newline between tag attributes). Thank you for the quick response!