[GH-ISSUE #810] Support underlining style via _ (underscores) and italics via * (asterisks) simultaneously #538

Closed
opened 2026-03-03 01:27:50 +03:00 by kerem · 5 comments
Owner

Originally created by @redactedscribe on GitHub (May 8, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/810

Regarding MD049: The only options are asterisk / consistent / underscore. If we could have a mixed or off option, we could use * for emphasis (italicisation) and _ for underlining without markdownlint complaining that we have inconsistent emphasis styling in play. This however would give up the checks we have for emphasising which isn't ideal.

Maybe some specific support could be given to underlining so that markdownlint could ensure we're using asterisks for emphasis and underscores for underlining? I don't know how common support for underlining in Markdown parsers is, but the Markdown Extended VS Code extension enables support for it (via something called markdown-it I think) and it would be cool if markdownlint could support underlining too.

Thanks.

markdownlint 0.50.0

Originally created by @redactedscribe on GitHub (May 8, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/810 [Regarding MD049](https://github.com/DavidAnson/markdownlint/blob/main/doc/md049.md): The only options are `asterisk` / `consistent` / `underscore`. If we could have a `mixed` or `off` option, we could use `*` for emphasis (italicisation) and `_` for underlining without markdownlint complaining that we have inconsistent emphasis styling in play. This however would give up the checks we have for emphasising which isn't ideal. Maybe some specific support could be given to underlining so that markdownlint could ensure we're using asterisks for emphasis and underscores for underlining? I don't know how common support for underlining in Markdown parsers is, but the [Markdown Extended VS Code extension](https://marketplace.visualstudio.com/items?itemName=jebbs.markdown-extended) enables support for it (via something called markdown-it I think) and it would be cool if markdownlint could support underlining too. Thanks. markdownlint 0.50.0
kerem 2026-03-03 01:27:50 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nschonni commented on GitHub (May 8, 2023):

"Underlining" isn't part of CommonMark spec https://spec.commonmark.org/0.30/. There asterisks and underscore both produce <em> elements only in compliant parsers

<!-- gh-comment-id:1538829709 --> @nschonni commented on GitHub (May 8, 2023): "Underlining" isn't part of CommonMark spec https://spec.commonmark.org/0.30/. There asterisks and underscore both produce `<em>` elements only in compliant parsers
Author
Owner

@DavidAnson commented on GitHub (May 8, 2023):

Agreed. This behavior is not per specification (the plug-in agrees: https://www.npmjs.com/package/markdown-it-underline) and it would be confusing to try to support it for this one isolated case.

<!-- gh-comment-id:1538938280 --> @DavidAnson commented on GitHub (May 8, 2023): Agreed. This behavior is not per specification (the plug-in agrees: https://www.npmjs.com/package/markdown-it-underline) and it would be confusing to try to support it for this one isolated case.
Author
Owner

@redactedscribe commented on GitHub (May 8, 2023):

I'm not educated enough on the details to argue otherwise so I'll have to agree. I thought it may be common among other parsers etc. Feel free to close if this is clear-cut.

<!-- gh-comment-id:1539067356 --> @redactedscribe commented on GitHub (May 8, 2023): I'm not educated enough on the details to argue otherwise so I'll have to agree. I thought it may be common among other parsers etc. Feel free to close if this is clear-cut.
Author
Owner

@redactedscribe commented on GitHub (May 9, 2023):

Another thought: Since underlining via underscore would just render as emphasised text in parsers which don't handle underscores vs asterisks differently, with an off option for MD049, we could at least use both styles in VS Code via Markdown Extended without markdownlint complaining, even if the linter won't support underlining specifically.

<!-- gh-comment-id:1539803705 --> @redactedscribe commented on GitHub (May 9, 2023): Another thought: Since underlining via underscore would just render as emphasised text in parsers which don't handle underscores vs asterisks differently, with an `off` option for MD049, we could at least use both styles in VS Code via Markdown Extended without markdownlint complaining, even if the linter won't support underlining specifically.
Author
Owner

@DavidAnson commented on GitHub (May 9, 2023):

An "off" setting would seem to be the same as disabling the rule. All rules can already be disabled via configuration. (See the README)

<!-- gh-comment-id:1540456125 --> @DavidAnson commented on GitHub (May 9, 2023): An "off" setting would seem to be the same as disabling the rule. All rules can already be disabled via configuration. (See the README)
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#538
No description provided.