[GH-ISSUE #512] MD030 in admonitions #2268

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

Originally created by @skwde on GitHub (Mar 28, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/512

MD030 currently doesn't apply to indented lists (ol / ul).

Based on this config:

# Default state for all rules
default: true

# MD003/heading-style/header-style - Heading style
MD003:
  # Heading style
  style: atx
#
# MD004/ul-style - Unordered list style
MD004:
  # List style
  style: sublist
#
# MD007/ul-indent - Unordered list indentation
MD007:
  # Spaces for indent
  indent: 4

# MD010/no-hard-tabs - Hard tabs
MD010:
  # Include code blocks
  code_blocks: true
  # Number of spaces for each hard tab
  spaces_per_tab: 4

# Disable line length check for tables and code blocks
# MD013/line-length - Line length
MD013:
  # Include code blocks
  code_blocks: false
  # Include tables
  tables: false

# MD029/ol-prefix - Ordered list item prefix
MD029:
  # List style
  style: ordered

# MD030/list-marker-space - Spaces after list markers
MD030:
  # Spaces for single-line unordered list items
  ul_single: 3
  # Spaces for single-line ordered list items
  ol_single: 2
  # Spaces for multi-line unordered list items
  ul_multi: 3
  # Spaces for multi-line ordered list items
  ol_multi: 2

# MD033/no-inline-html - Inline HTML
MD033:
  # Allowed elements
  allowed_elements: [br]

# MD046/code-block-style - Code block style
# conflicting with admonitions...
MD046: false

# MD048/code-fence-style - Code fence style
MD048:
  # Code fence style
  style: backtick

Just look at the errors in

A ul

- def

and a ol ul combination

1. abc
    - cde

vs

!!! note "admonition test as e.g. used / defined in mkdocs material"
    1. abc
        - cde

    or

    - def

and you will notice that only the case outside the admonition displays an error

Tested on

  • markdownlint version 0.30.0
  • installed via node version 16.13.0
  • on Mac 11.6.5
Originally created by @skwde on GitHub (Mar 28, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/512 MD030 currently doesn't apply to indented lists (ol / ul). Based on this config: ```yml # Default state for all rules default: true # MD003/heading-style/header-style - Heading style MD003: # Heading style style: atx # # MD004/ul-style - Unordered list style MD004: # List style style: sublist # # MD007/ul-indent - Unordered list indentation MD007: # Spaces for indent indent: 4 # MD010/no-hard-tabs - Hard tabs MD010: # Include code blocks code_blocks: true # Number of spaces for each hard tab spaces_per_tab: 4 # Disable line length check for tables and code blocks # MD013/line-length - Line length MD013: # Include code blocks code_blocks: false # Include tables tables: false # MD029/ol-prefix - Ordered list item prefix MD029: # List style style: ordered # MD030/list-marker-space - Spaces after list markers MD030: # Spaces for single-line unordered list items ul_single: 3 # Spaces for single-line ordered list items ol_single: 2 # Spaces for multi-line unordered list items ul_multi: 3 # Spaces for multi-line ordered list items ol_multi: 2 # MD033/no-inline-html - Inline HTML MD033: # Allowed elements allowed_elements: [br] # MD046/code-block-style - Code block style # conflicting with admonitions... MD046: false # MD048/code-fence-style - Code fence style MD048: # Code fence style style: backtick ``` Just look at the errors in ``` A ul - def and a ol ul combination 1. abc - cde vs !!! note "admonition test as e.g. used / defined in mkdocs material" 1. abc - cde or - def and you will notice that only the case outside the admonition displays an error ``` Tested on - markdownlint version 0.30.0 - installed via node version 16.13.0 - on Mac 11.6.5
kerem 2026-03-07 20:06:09 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nschonni commented on GitHub (Mar 28, 2022):

Syntax isn't supported, see https://github.com/DavidAnson/markdownlint/issues/207

<!-- gh-comment-id:1080815853 --> @nschonni commented on GitHub (Mar 28, 2022): Syntax isn't supported, see https://github.com/DavidAnson/markdownlint/issues/207
Author
Owner

@DavidAnson commented on GitHub (Mar 28, 2022):

See #207 for information about adding recognition of admonitions to the parser via a plug-in. Note that markdoenlint-cli2 supports using parser plug-ins.

<!-- gh-comment-id:1080815908 --> @DavidAnson commented on GitHub (Mar 28, 2022): See #207 for information about adding recognition of admonitions to the parser via a plug-in. Note that markdoenlint-cli2 supports using parser plug-ins.
Author
Owner

@DavidAnson commented on GitHub (Mar 28, 2022):

(You beat me by 4 seconds, Nick!)

<!-- gh-comment-id:1080817223 --> @DavidAnson commented on GitHub (Mar 28, 2022): (You beat me by 4 seconds, Nick!)
Author
Owner

@skwde commented on GitHub (Mar 31, 2022):

Thanks for the quick replies from both of you.

As mentioned in the other issue already it seems the plugin is no longer maintained (last commit from 4 years ago)...

Are there still no plans to support admonitions?

<!-- gh-comment-id:1084123629 --> @skwde commented on GitHub (Mar 31, 2022): Thanks for the quick replies from both of you. As mentioned in the other issue already it seems the plugin is no longer maintained (last commit from 4 years ago)... Are there still no plans to support admonitions?
Author
Owner

@DavidAnson commented on GitHub (Mar 31, 2022):

I do not have plans for admonitions. If there is something lacking with that plug-in, I would appreciate if someone helped improve it.

<!-- gh-comment-id:1084151339 --> @DavidAnson commented on GitHub (Mar 31, 2022): I do not have plans for admonitions. If there is something lacking with that plug-in, I would appreciate if someone helped improve it.
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#2268
No description provided.