mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #1080] Ignore long lines in HTML comments #609
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#609
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 @ruzickap on GitHub (Dec 24, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1080
Hello.
Is there a way how to skip all checks inside the HTML comments in markdown file?
Example:
It would be nice if markdownlint will ignore everything inside
<!---...-->.Currently I do not know how to ignore commented long like in markdown.
Thank you
@DavidAnson commented on GitHub (Dec 24, 2023):
The content of HTML comments is generally ignored by default. In the case here, MD013 is operating in its default/enabled configuration which reports lines longer than 80 characters as being too long. Unlike some Markdown constructs, HTML comments can be wrapped so this is possible/easy to address. You can read more here: https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md.
The second line you show is not an HTML comment, but a valid link reference definition. It is not reported as being unused because that pattern is specifically ignored. More info on that here: https://github.com/DavidAnson/markdownlint/blob/main/doc/md053.md. But it can be easily wrapped as well.
If you don't like this rule, you can disable it using any of the techniques described in the documentation. But here is your example updated to produce no violations of the line-length rule:
https://dlaa.me/markdownlint/#%25m%23%20Issue%201080%0A%0A%3C!--%0AComponentStatus%20(and%20ComponentStatusList)%20holds%20the%20cluster%20validation%20info.%0ADeprecated%3A%20This%20API%20is%20deprecated%20in%20v1.19%2B%0A--%3E%0A%0A%5B%2F%2F%5D%3A%20%23%20ComponentStatus%20(and%20ComponentStatusList)%20holds%20the%20cluster%20validation%20info.%0ADeprecated%3A%20This%20API%20is%20deprecated%20in%20v1.19%2B%0A%0A%3C!--%20markdownlint-enable-file%20md013%20--%3E
@DavidAnson commented on GitHub (Dec 24, 2023):
Update: The example link reference definition is almost valid. If it is quoted properly, it will not report a length violation even without wrapping:
@ruzickap commented on GitHub (Dec 25, 2023):
Thank you for a quick reaction David.
You are right in both cases, but the sentence I use is just example.
My real usecase is:
I have some command (visible to the reader) in markdown and then the command's output which should be hidden for the user (but needs to be preserved for the "technical writer"):
Anyway - I solved it using
<!-- markdownlint-disable -->like mentioned in Configuration section:Thank you for a quick response...