[GH-ISSUE #214] <br> in table triggers MD33 #2031

Closed
opened 2026-03-07 20:03:51 +03:00 by kerem · 10 comments
Owner

Originally created by @darkantoine on GitHub (Aug 22, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/214

We use
inside table to spreads the description in a cell over several lines to add readibility.
This triggers MD33 but I dont think it should.

Originally created by @darkantoine on GitHub (Aug 22, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/214 We use <br> inside table to spreads the description in a cell over several lines to add readibility. This triggers MD33 but I dont think it should.
kerem 2026-03-07 20:03:51 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Aug 22, 2019):

It sounds like you think the rule is behaving as described, but don’t like that behavior in your scenario? If so, you can disable MD033 entirely or use the allowed_elements parameter to exempt just the br tag.

<!-- gh-comment-id:523966745 --> @DavidAnson commented on GitHub (Aug 22, 2019): It sounds like you think the rule is behaving as described, but don’t like that behavior in your scenario? If so, you can disable `MD033` entirely or use the `allowed_elements` parameter to exempt just the `br` tag.
Author
Owner

@twilight-moon commented on GitHub (Aug 28, 2019):

How do I disable MD033? In VSCode if I go to extension settings and under the Markdownlint:ignore section I added MD033. The problems area clears. When I go back to my document the MD033 entries show up again in the problems area.

<!-- gh-comment-id:525763725 --> @twilight-moon commented on GitHub (Aug 28, 2019): How do I disable MD033? In VSCode if I go to extension settings and under the Markdownlint:ignore section I added MD033. The problems area clears. When I go back to my document the MD033 entries show up again in the problems area.
Author
Owner

@DavidAnson commented on GitHub (Aug 28, 2019):

@twilight-moon, it does not sound like you are disabling the rule correctly. Could you please show an example of the change you’re making?

For reference, here is the relevant documentation (note: config, not ignore): https://github.com/DavidAnson/vscode-markdownlint/blob/master/README.md#markdownlintconfig

<!-- gh-comment-id:525820172 --> @DavidAnson commented on GitHub (Aug 28, 2019): @twilight-moon, it does not sound like you are disabling the rule correctly. Could you please show an example of the change you’re making? For reference, here is the relevant documentation (note: config, not ignore): https://github.com/DavidAnson/vscode-markdownlint/blob/master/README.md#markdownlintconfig
Author
Owner

@twilight-moon commented on GitHub (Aug 28, 2019):

Below is a screenshot of the setting:
image

I guess this is editing settings.json. On Mac is user/Library/Application Support/Code/User/settings.json. Reading the documentation in the link above it looks like I create a file .markdownlint.json in my home directory with the below. I did that but it still shows in the problems area.

{
    "MD033": false
}

After scrolling further down in the documentation I found inserting this line before the html table
<!-- markdownlint-disable MD033 --> and that worked.

Thanks for your help.

<!-- gh-comment-id:525861788 --> @twilight-moon commented on GitHub (Aug 28, 2019): Below is a screenshot of the setting: ![image](https://user-images.githubusercontent.com/49955837/63879169-2174e900-c999-11e9-8f46-e2249ac03faf.png) I guess this is editing settings.json. On Mac is user/Library/Application Support/Code/User/settings.json. Reading the documentation in the link above it looks like I create a file .markdownlint.json in my home directory with the below. I did that but it still shows in the problems area. ``` { "MD033": false } ``` After scrolling further down in the documentation I found inserting this line before the html table `<!-- markdownlint-disable MD033 -->` and that worked. Thanks for your help.
Author
Owner

@DavidAnson commented on GitHub (Aug 28, 2019):

The screenshot shows editing ignore, not config - that’s the wrong section. Your .markdownlint.json file looks good and can be put in the root folder of the current project to apply to the files within. The HTML comment you show is another good approach. Glad you got this sorted!

<!-- gh-comment-id:525872949 --> @DavidAnson commented on GitHub (Aug 28, 2019): The screenshot shows editing ignore, not config - that’s the wrong section. Your .markdownlint.json file looks good and can be put in the root folder of the current project to apply to the files within. The HTML comment you show is another good approach. Glad you got this sorted!
Author
Owner

@DavidAnson commented on GitHub (Aug 31, 2019):

Closing as it seems the original and related questions are both addressed.

<!-- gh-comment-id:526863720 --> @DavidAnson commented on GitHub (Aug 31, 2019): Closing as it seems the original and related questions are both addressed.
Author
Owner

@afeblot commented on GitHub (May 26, 2025):

@DavidAnson , I find myself in the same situation where I have MD033 enabled and currently only allowing <br/> tags because I consider them needed in tables. However, I'd be happy to forbid them elsewhere.

If I succeed submitting a PR adding a "allowed_in_tables" option to MD033, will you consider it for merge?

<!-- gh-comment-id:2909953829 --> @afeblot commented on GitHub (May 26, 2025): @DavidAnson , I find myself in the same situation where I have MD033 enabled and currently only allowing `<br/>` tags because I consider them needed in tables. However, I'd be happy to forbid them elsewhere. If I succeed submitting a PR adding a "allowed_in_tables" option to MD033, will you consider it for merge?
Author
Owner

@DavidAnson commented on GitHub (May 26, 2025):

For consistency, I'd say it should be named table_allowed_elements. Seems like it could be simple to add by applying a check of this list and parent token check for the table container before reporting violations (along with tests).

<!-- gh-comment-id:2910365917 --> @DavidAnson commented on GitHub (May 26, 2025): For consistency, I'd say it should be named `table_allowed_elements`. Seems like it could be simple to add by applying a check of this list and parent token check for the `table` container before reporting violations (along with tests).
Author
Owner

@afeblot commented on GitHub (May 26, 2025):

Yes, right. I'll look into this, thanks.

<!-- gh-comment-id:2910551099 --> @afeblot commented on GitHub (May 26, 2025): Yes, right. I'll look into this, thanks.
Author
Owner

@afeblot commented on GitHub (May 26, 2025):

https://github.com/DavidAnson/markdownlint/pull/1615

<!-- gh-comment-id:2910731243 --> @afeblot commented on GitHub (May 26, 2025): https://github.com/DavidAnson/markdownlint/pull/1615
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#2031
No description provided.