From 7493ee3880f56fa99803e381b9a09bffaa731d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 30 Oct 2015 15:53:43 +0100 Subject: [PATCH 1/3] Markdown linter: Allow multiple headers with same content Remove rule MD024 from linter checks. This means that having multiple markdown headers with the same title will not be a problem anymore. This was annoying for documents like this (example taken from IronMan-Vault): ```md # Vault API ## Data Structures ### Account ### User ### Role ## Database ### Account ### User ### Role ``` Drawback: anchors generated by GitHub (to allow creating URLs pointing directly to a paragraph) will collide for headers with the same label. --- bin/mdlint.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/mdlint.js b/bin/mdlint.js index ad6ad74..7bc6fed 100644 --- a/bin/mdlint.js +++ b/bin/mdlint.js @@ -9,10 +9,11 @@ const files = commander.parse(process.argv).args; // See rules at https://github.com/mivok/markdownlint/blob/master/docs/RULES.md const config = { - "MD004": false, - "MD027": false, - "MD034": false, - "MD040": false, + "MD004": false, // Unordered list style + "MD024": false, // Multiple headers with the same content + "MD027": false, // Multiple spaces after blockquote symbol + "MD034": false, // Bare URL used + "MD040": false, // Fenced code blocks should have a language specified }; const result = markdownlint.sync({ files: files, config: config }); From 01fb09b0b092cfe56537a35c96450aa6e5aaf523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 30 Oct 2015 21:53:11 +0100 Subject: [PATCH 2/3] Markdown linter: Fix ordered list item prefixes The default behavior when rule MD029 isn't given arguments is pretty weird: it only accepts list with `1.` prefixes, e.g.: 1. Do this. 1. Do that. 1. Done. This patch changes the style to "ordered" so valid lists look like: 1. Do this. 2. Do that. 3. Done. --- bin/mdlint.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/mdlint.js b/bin/mdlint.js index 7bc6fed..dbba8c8 100644 --- a/bin/mdlint.js +++ b/bin/mdlint.js @@ -12,6 +12,7 @@ const config = { "MD004": false, // Unordered list style "MD024": false, // Multiple headers with the same content "MD027": false, // Multiple spaces after blockquote symbol + "MD029": { "style": "ordered" }, // Ordered list item prefix "MD034": false, // Bare URL used "MD040": false, // Fenced code blocks should have a language specified }; From 4d8dcb51b9dd4af62cbfbcc590c98af4dc5b6890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 30 Oct 2015 21:56:32 +0100 Subject: [PATCH 3/3] Markdown linter: Disable buggy MD007 rule Rule MD007 (unordered list indentation) is very restrictive and sometimes annoying. For instance, it detects such lists as invalid because of the nested one indentation: 1. First, look at this list * nested item 1 * nested item 2 2. Then, another ordered item This patch disables this rule. --- bin/mdlint.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/mdlint.js b/bin/mdlint.js index dbba8c8..94d5108 100644 --- a/bin/mdlint.js +++ b/bin/mdlint.js @@ -10,6 +10,7 @@ const files = commander.parse(process.argv).args; // See rules at https://github.com/mivok/markdownlint/blob/master/docs/RULES.md const config = { "MD004": false, // Unordered list style + "MD007": false, // Unordered list indentation "MD024": false, // Multiple headers with the same content "MD027": false, // Multiple spaces after blockquote symbol "MD029": { "style": "ordered" }, // Ordered list item prefix