[GH-ISSUE #293] Top of file markdownlint comment displays in the browser #251

Closed
opened 2026-03-03 01:25:08 +03:00 by kerem · 2 comments
Owner

Originally created by @185driver on GitHub (Jun 3, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/293

It seems my top of file markdownlint comment is wrapped in paragraph tags when sent to the browser (Chrome). As a result, my comment displays along with my markdown text. Can this wrapping behavior be avoided? I'd prefer comments not to be displayed.

<!-- markdownlint-disable MD024 -->
# Title
<p>&lt;!-- markdownlint-disable MD024 --&gt;</p>
<h1 id="title">Title</h1>
Originally created by @185driver on GitHub (Jun 3, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/293 It seems my top of file markdownlint comment is wrapped in paragraph tags when sent to the browser (Chrome). As a result, my comment displays along with my markdown text. Can this wrapping behavior be avoided? I'd prefer comments not to be displayed. ```md <!-- markdownlint-disable MD024 --> # Title ``` ```html <p>&lt;!-- markdownlint-disable MD024 --&gt;</p> <h1 id="title">Title</h1> ```
kerem 2026-03-03 01:25:08 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jun 3, 2020):

markdownlint does not render anything, so the paragraph wrapping behavior you describe is being done by some other tool in your workflow. If that tool supports comments but just not at the top of the file, you can use the markdownlint-disable-file comment to move that to the bottom of your file instead (and have it still apply to the entire file). If your renderer does not support comments at all, you may need to change the markdownlint configuration in JSON or YAML instead.

<!-- gh-comment-id:638278916 --> @DavidAnson commented on GitHub (Jun 3, 2020): markdownlint does not render anything, so the paragraph wrapping behavior you describe is being done by some other tool in your workflow. If that tool supports comments but just not at the top of the file, you can use the `markdownlint-disable-file` comment to move that to the bottom of your file instead (and have it still apply to the entire file). If your renderer does not support comments at all, you may need to change the markdownlint configuration in JSON or YAML instead.
Author
Owner

@185driver commented on GitHub (Jun 3, 2020):

@DavidAnson Thank you for replying. You're right, my apologies. It was being caused by a setting in the Markdown Preview Plus Chrome extension I use to display markdown in the browser. Resolved.

<!-- gh-comment-id:638285792 --> @185driver commented on GitHub (Jun 3, 2020): @DavidAnson Thank you for replying. You're right, my apologies. It was being caused by a setting in the Markdown Preview Plus Chrome extension I use to display markdown in the browser. Resolved.
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#251
No description provided.