mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[PR #2] [CLOSED] feature(config): adding config.ignore to replace metadata #2647
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2647
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/DavidAnson/markdownlint/pull/2
Author: @rodneyrehm
Created: 7/20/2015
Status: ❌ Closed
Base:
master← Head:feature/ignore-frontmatter📝 Commits (1)
414e774feature(config): adding config.ignore to replace metadata (e.g. frontmatter) before linting📊 Changes
4 files changed (+41 additions, -0 deletions)
View changed files
📝
README.md(+1 -0)📝
lib/markdownlint.js(+28 -0)➕
test/ignore_frontmatter.json(+5 -0)➕
test/ignore_frontmatter.md(+7 -0)📄 Description
My markdown files contain frontmatter to configure the documentation build system. That code is erroneously detected as a headline and subsequently fails MD002 and MD003. (github displays the frontmatter as a table). Should you wish to parse the the frontmatter properly, the gray-matter package might be a good place to start.
This PR adds the config option
ignorewith which any part of a markdown file can be replaced by line breaks (to preserve the line-markings of the actual tests) before the markdown file is linted. Because frontmatter seems to be used by a couple of systems (Jekyll and metalsmith being the ones I use), I added the regular expression to your code directly and acitvating it ifconfig.ignore === 'frontmatter'is passed in.Cheers!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.