[GH-ISSUE #361] MD033 triggers for elements in HTML comment sections #2149

Closed
opened 2026-03-07 20:05:02 +03:00 by kerem · 5 comments
Owner

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

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
kerem 2026-03-07 20:05:02 +03:00
Author
Owner

@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.

<!-- gh-comment-id:758432177 --> @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`.
Author
Owner

@nschonni commented on GitHub (Jan 17, 2021):

I'm still getting this running from markdownlint-cli

$ markdownlint "**/*.md" -i "entity-framework/ef6/"
entity-framework/core/logging-events-diagnostics/interceptors.md:90:39 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:93:27 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:100:49 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:103:27 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:108:48 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:230:49 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:233:27 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:244:48 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:249:48 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/logging-events-diagnostics/interceptors.md:263:36 MD033/no-inline-html Inline HTML [Element: DbDataReader]
entity-framework/core/saving/cascade-delete.md:470:27 MD033/no-inline-html Inline HTML [Element: database]
entity-framework/core/saving/cascade-delete.md:474:27 MD033/no-inline-html Inline HTML [Element: database]

nick_@DESKTOP-OKIMI68 MINGW64 /z/EntityFramework.Docs (master)
$ markdownlint --version
0.26.0
<!-- gh-comment-id:761863941 --> @nschonni commented on GitHub (Jan 17, 2021): I'm still getting this running from markdownlint-cli ``` $ markdownlint "**/*.md" -i "entity-framework/ef6/" entity-framework/core/logging-events-diagnostics/interceptors.md:90:39 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:93:27 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:100:49 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:103:27 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:108:48 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:230:49 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:233:27 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:244:48 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:249:48 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/logging-events-diagnostics/interceptors.md:263:36 MD033/no-inline-html Inline HTML [Element: DbDataReader] entity-framework/core/saving/cascade-delete.md:470:27 MD033/no-inline-html Inline HTML [Element: database] entity-framework/core/saving/cascade-delete.md:474:27 MD033/no-inline-html Inline HTML [Element: database] nick_@DESKTOP-OKIMI68 MINGW64 /z/EntityFramework.Docs (master) $ markdownlint --version 0.26.0 ```
Author
Owner

@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

<!-- gh-comment-id:761864219 --> @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
Author
Owner

@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

<!-- gh-comment-id:761873714 --> @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
Author
Owner

@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).

<!-- gh-comment-id:769613647 --> @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).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2149
No description provided.