mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #361] MD033 triggers for elements in HTML comment sections #302
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#302
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 @nschonni on GitHub (Dec 31, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/361
Ref: https://github.com/dotnet/EntityFramework.Docs/pull/2966
When there are HTML (or HTML-like) elements in HTML comment sections, they still trigger MD033 errors
@DavidAnson commented on GitHub (Jan 12, 2021):
@nschonni, could you provide an example, please? I can paste the current version of the file from that PR (https://raw.githubusercontent.com/nschonni/EntityFramework.Docs/586e4ebdb728a6b1719b77b4a29ed75a03afc5e1/entity-framework/core/logging-events-diagnostics/interceptors.md) into the demo page (https://dlaa.me/markdownlint/) without triggering any instances of
MD033.@nschonni commented on GitHub (Jan 17, 2021):
I'm still getting this running from markdownlint-cli
@nschonni commented on GitHub (Jan 17, 2021):
@DavidAnson ah, from the PR, I had stripped the commented out code that was triggering the issue. But if you paste the current file, you'll see the same issue.
Second file looks like something they missed because the rule is off
@DavidAnson commented on GitHub (Jan 17, 2021):
Simplified repro: https://dlaa.me/markdownlint/#%25m%23%20Interceptors%0A%0A%3C!--%0Apublic%20class%20TaggedQueryCommandInterceptor%20%3A%20DbCommandInterceptor%0A%7B%0A%20%20%20%20public%20override%20InterceptionResult%3CDbDataReader%3E%20ReaderExecuting(%0A%20%20%20%20%20%20%20%20DbCommand%20command%2C%0A%20%20%20%20%20%20%20%20CommandEventData%20eventData%2C%0A%20%20%20%20%20%20%20%20InterceptionResult%3CDbDataReader%3E%20result)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20ManipulateCommand(command)%3B%0A%0A%20%20%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20public%20override%20ValueTask%3CInterceptionResult%3CDbDataReader%3E%3E%20ReaderExecutingAsync(%0A%20%20%20%20%20%20%20%20DbCommand%20command%2C%0A%20%20%20%20%20%20%20%20CommandEventData%20eventData%2C%0A%20%20%20%20%20%20%20%20InterceptionResult%3CDbDataReader%3E%20result%2C%0A%20%20%20%20%20%20%20%20CancellationToken%20cancellationToken%20%3D%20default)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20ManipulateCommand(command)%3B%0A%0A%20%20%20%20%20%20%20%20return%20new%20ValueTask%3CInterceptionResult%3CDbDataReader%3E%3E(result)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20private%20static%20void%20ManipulateCommand(DbCommand%20command)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20(command.CommandText.StartsWith(%22--%20Use%20hint%3A%20robust%20plan%22%2C%20StringComparison.Ordinal))%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20command.CommandText%20%2B%3D%20%22%20OPTION%20(ROBUST%20PLAN)%22%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A--%3E%0A
@DavidAnson commented on GitHub (Jan 29, 2021):
The CommonMark and HTML specs don't agree on what constitutes a comment. The CommonMark spec is explicit that "--" is NOT allowed in a comment: https://spec.commonmark.org/0.29/#html-comment. However, their dingus ALLOWS "--" within a comment. So I think my commit above stands (though it reveals a new library issue in the docs/docs repository).