[GH-ISSUE #394] MD043 - Using the special value "*" results in subsequent required header values being ignored #2178

Closed
opened 2026-03-07 20:05:17 +03:00 by kerem · 1 comment
Owner

Originally created by @jeremysuriel on GitHub (May 14, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/394

When using a special value "*" for zero or more headings, subsequent required headings in the rule are ignored.

For example, if you change the following line to any value, the tests will continue to pass: https://github.com/DavidAnson/markdownlint/blob/main/test/required-headings-zero-or-more.json#L9 .

I.e.

{
  "default": true,
  "MD043": {
    "headings": [
      "# One",
      "*",
      "### ANY VALUE HERE1",
      "*",
      "### ANY VALUE HERE2",
      "*",
      "#### ANY VALUE HERE3"
    ]
  }
}

This markdown will still show no errors regardless of whether the "ANY VALUE HERE" header is present or not.

# One

## Two

### THREE

## four

## Five

### SiX

#### 7

This looks to be related to the change here: github.com/DavidAnson/markdownlint@e20502c494 .

Originally created by @jeremysuriel on GitHub (May 14, 2021). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/394 When using a special value `"*"` for zero or more headings, subsequent required headings in the rule are ignored. For example, if you change the following line to any value, the tests will continue to pass: https://github.com/DavidAnson/markdownlint/blob/main/test/required-headings-zero-or-more.json#L9 . I.e. ```json { "default": true, "MD043": { "headings": [ "# One", "*", "### ANY VALUE HERE1", "*", "### ANY VALUE HERE2", "*", "#### ANY VALUE HERE3" ] } } ``` This markdown will still show no errors regardless of whether the "ANY VALUE HERE" header is present or not. ``` # One ## Two ### THREE ## four ## Five ### SiX #### 7 ``` This looks to be related to the change here: https://github.com/DavidAnson/markdownlint/commit/e20502c494c8b8d7f2640c141343c176af4363b6 .
kerem 2026-03-07 20:05:17 +03:00
Author
Owner
<!-- gh-comment-id:840934018 --> @DavidAnson commented on GitHub (May 14, 2021): Repro: https://dlaa.me/markdownlint/#%25m%23%20One%0A%0A%23%23%20Two%0A%0A%23%23%23%20THREE%0A%0A%23%23%20four%0A%0A%23%23%20Five%0A%0A%23%23%23%20SiX%0A%0A%23%23%23%23%207%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%22default%22%3A%20true%2C%0A%20%20%22MD043%22%3A%20%7B%0A%20%20%20%20%22headings%22%3A%20%5B%0A%20%20%20%20%20%20%22%23%20One%22%2C%0A%20%20%20%20%20%20%22*%22%2C%0A%20%20%20%20%20%20%22%23%23%23%20ANY%20VALUE%20HERE1%22%2C%0A%20%20%20%20%20%20%22*%22%2C%0A%20%20%20%20%20%20%22%23%23%23%20ANY%20VALUE%20HERE2%22%2C%0A%20%20%20%20%20%20%22*%22%2C%0A%20%20%20%20%20%20%22%23%23%23%23%20ANY%20VALUE%20HERE3%22%0A%20%20%20%20%5D%0A%20%20%7D%0A%7D%20--%3E%0A
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#2178
No description provided.