mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #832] Latest version seems to lint into multiline HTML comments despite html_elements: false #544
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#544
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 @Ravlen on GitHub (May 25, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/832
As the title says, we tried rolling out the latest version and noticed that this version is linting into multi-line HTML comments, ignoring our
html_elements: falsesetting, at least for rule MD044.This doesn't work:
This gets ignored as expected:
It looks like it only works if the line either starts with
<!--or ends with-->:@okalachev commented on GitHub (May 28, 2023):
Also having a problem with this parameter.
Works for single line HTML, but doesn't work for multi-line:
Version 0.34.0.
@DavidAnson commented on GitHub (May 29, 2023):
@okalachev, OCR and attempting to reproduce your own example gives me two issues, not one. What am I missing?
https://dlaa.me/markdownlint/#%25m%23%20Issue%20832%0A%0A%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%0A%3Cdiv%3E%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%3C%2Fdiv%3E%0A%3Cdiv%3E%0A%20%20%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%0A%3C%2Fdiv%3E%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%22MD033%22%3A%20false%2C%0A%20%20%22MD044%22%3A%20%7B%0A%20%20%20%20%22html_elements%22%3A%20false%2C%0A%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%22HTTPS%22%0A%20%20%20%20%5D%0A%20%20%7D%0A%7D%20--%3E%0A
@okalachev commented on GitHub (May 29, 2023):
@DavidAnson, sorry for using an image instead of text, but I wanted to emphasize the detected error.
Here is what I'm showing: https://dlaa.me/markdownlint/#%25m%23%20Issue%20832%0A%0A%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%0A%0A%3Cdiv%3E%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%3C%2Fdiv%3E%0A%0A%3Cdiv%3E%0A%20%20%3Ca%20href%3D%22https%3A%2F%2Fexample.org%22%3E%0A%3C%2Fdiv%3E%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%22MD033%22%3A%20false%2C%0A%20%20%22MD044%22%3A%20%7B%0A%20%20%20%20%22html_elements%22%3A%20false%2C%0A%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%22HTTPS%22%0A%20%20%20%20%5D%0A%20%20%7D%0A%7D%20--%3E%0A.
Two single-line HTMLs (OK), one multiline (not OK).
@DavidAnson commented on GitHub (May 29, 2023):
Your example shows the same behavior as mine. This difference is probably not important since the fix for both scenarios is probably the same. I'll have a look soon.
@DavidAnson commented on GitHub (May 29, 2023):
(Aha, the difference in samples is whether there are blank lines above/below the middle line.)
@DavidAnson commented on GitHub (May 29, 2023):
Where we're at:
@Ravlen, your issue is fixed by the commit above.
@okalachev, your issue has turned up other issues... :)
@Ravlen commented on GitHub (May 29, 2023):
@DavidAnson As always, you do wonderful work! I'd love to make the PRs to fix these myself, but I'm only smart enough to use your great tool, not help out with it 😅
@DavidAnson commented on GitHub (May 29, 2023):
@Ravlen :) Thanks! I try to make the rules as simple as possible, but some of them are almost absurdly tricky. Maybe if I were smarter, some of this would be more approachable!
@okalachev commented on GitHub (May 29, 2023):
Agreed about wonderful work, thanks to this tool we can keep the source code of our big documentation site clean and consistent.
But due to these MD044 issues with HTML I can't switch do the latest version unfortunately.