Skip to content

Commit

Permalink
Update Markdown-Lint + Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt authored Jul 23, 2022
1 parent 5fe9671 commit 66affec
Show file tree
Hide file tree
Showing 14 changed files with 197 additions and 99 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,14 @@ May be covered by: [#138](https://github.com/DavidAnson/markdownlint/issues/138)
1. Test
```

**Unable to enforce emphasis consistency:**

Will be fixed by: [#150](https://github.com/DavidAnson/markdownlint/issues/150)

```markdown
_This should be flagged for using an underscore instead of asterisk for emphasis_
```

**Trailing whitespace not caught in unordered list empty line:**

[#216](https://github.com/DavidAnson/markdownlint/issues/216)

```markdown
* Example
* There are two spaces on the next line
* The line above this should be flagged for trailing whitespace
```

Expand All @@ -83,24 +75,24 @@ The complete morons over at CommonMark, have decided to incorrectly parse list i
1. Top level ordered list
* Sublist with 2 space indentation
* CommonMark only parses this as a sublist if it starts with 3 spaces.
* CommonMark only parses this as a sublist if it starts with 3 spaces. You know? 3 spaces? A super normal amount of spaces for indentation that normal people who aren't fucking idiots would totally use. Yup. 3 spaces. That's the hill they are choosing to die on. Totally valid. Not fucking stupid at all.
```

```markdown
25. Top level ordered list
* Sublist with 2 space indentation
* CommonMark only parses this as a sublist if it starts with 4 spaces.
* CommonMark only parses this as a sublist if it starts with 4 spaces. Oh good, it's actually a variable amount of spaces. Even fucking better. I sure do love indentation that varies by single character increments. I'm really happy I use a linter to ENFORCE INCONSISTENCIES.
```

```markdown
116. Top level ordered list
* Sublist with 2 space indentation
* CommonMark only parses this as a sublist if it starts with 5 spaces.
* CommonMark only parses this as a sublist if it starts with 5 spaces. fuck everything
```

Since MarkdownLint relies on [markdown-it](https://markdown-it.github.io), which is built on top of the horrible "CommonMark" version of markdown, you are stuck with this shitty bullshit. I have enabled the MD006 to catch this if your code uses shitty CommonMark to be processed to HTML. However if you use a *good* markdown interpreter, then you should turn MD006 off, because it will try to make you over-indent to satisfy MarkdownLint's internal interpretter (markdown-it).
Since MarkdownLint relies on [markdown-it](https://markdown-it.github.io), which is built on top of the horrible "CommonMark" version of markdown, you are stuck with this shitty bullshit. I have enabled the MD006 to catch this if your code uses shitty CommonMark to be processed to HTML. However if you use a *good* markdown interpreter, then you should turn MD006 off, because it will try to make you over-indent to satisfy MarkdownLint's internal interpretter (markdown-it), and likely fuck up something else.

To disable it, add this to your `.markdownlint.yml`:

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tjw-markdownlint-rules",
"version": "1.0.1",
"version": "1.1.0",
"description": "The Jared Wilcurt's Markdown linting rules",
"main": "index.js",
"scripts": {
Expand All @@ -27,6 +27,6 @@
},
"homepage": "https://github.com/TheJaredWilcurt/tjw-markdownlint-rules#readme",
"devDependencies": {
"markdownlint-cli": "^0.18.0"
"markdownlint-cli": "^0.32.0"
}
}
3 changes: 2 additions & 1 deletion test-files/md005.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Inconsistent indentation for list items at the same level
* list-indent: true
* list-indent: true
* extra space
File renamed without changes.
2 changes: 1 addition & 1 deletion test-files/md038.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Spaces inside ` code span ` elements
Spaces inside ` code span ` elements sadly allowed. See: https://github.com/DavidAnson/markdownlint/issues/473

no-space-in-code: ` true`

Expand Down
4 changes: 2 additions & 2 deletions test-files/md042.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[No empty links]()

[no-empty-links: true](#)
[No empty links](#)

[No empty links](#example)

[no-empty-links: true](https://example.com)
[no empty links](https://example.com)
11 changes: 11 additions & 0 deletions test-files/md048.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Code fence style

```js
const message = 'This is fine.';
console.log(message);
```

~~~js
const = 'What is wrong with you?';
console.log(message);
~~~
5 changes: 5 additions & 0 deletions test-files/md049.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Emphasis style

This is *good*.

This is _bad_.
5 changes: 5 additions & 0 deletions test-files/md050.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Strong style

This is **good**.

This is __bad__.
5 changes: 5 additions & 0 deletions test-files/md051.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MD051

[Link exists](#md051)

[Link does not exist](#fragment)
20 changes: 20 additions & 0 deletions test-files/md052.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Full: [text][label]
Collapsed: [label][]
Shortcut: [label]

Full: ![text][image]
Collapsed: ![image][]
Shortcut: ![image]

[label]: https://example.com/label
[image]: https://example.com/image

* * *

Full: [Words][content]
Collapsed: [content][]
Shortcut: [content]

Full: ![Words][picture]
Collapsed: ![picture][]
Shortcut: ![picture]
13 changes: 13 additions & 0 deletions test-files/md053.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Full: [text][label]
Collapsed: [label][]
Shortcut: [label]

Full: ![text][image]
Collapsed: ![image][]
Shortcut: ![image]

[label]: https://example.com/label
[image]: https://example.com/image

[content]: https://exampl.com/content
[picture]: https://exampl.com/picture
Loading

0 comments on commit 66affec

Please sign in to comment.