mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add support to MD011 for Markdown Extra-style footnotes (fixes #18).
This commit is contained in:
parent
cfef715ed3
commit
83639b8ef8
3 changed files with 17 additions and 1 deletions
|
@ -260,6 +260,10 @@ To fix this, swap the `[]` and `()` around:
|
|||
|
||||
[Correct link syntax](http://www.example.com/)
|
||||
|
||||
Note: [Markdown Extra](https://en.wikipedia.org/wiki/Markdown_Extra)-style footnotes do not trigger this rule:
|
||||
|
||||
For (example)[^1]
|
||||
|
||||
## MD012 - Multiple consecutive blank lines
|
||||
|
||||
Tags: whitespace, blank_lines
|
||||
|
|
|
@ -327,7 +327,7 @@ module.exports = [
|
|||
"aliases": [ "no-reversed-links" ],
|
||||
"func": function MD011(params, errors) {
|
||||
forEachInlineChild(params, "text", function forToken(token) {
|
||||
if (/\([^)]+\)\[[^\]]+\]/.test(token.content)) {
|
||||
if (/\([^)]+\)\[[^\]^][^\]]*\]/.test(token.content)) {
|
||||
errors.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
|
|
12
test/markdown-extra-footnote.md
Normal file
12
test/markdown-extra-footnote.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Header
|
||||
|
||||
Text with Markdown Extra footnote[^1]
|
||||
|
||||
Text with (parenthesized footnote)[^2]
|
||||
|
||||
This is not a (parenthesized footnote)[x^y] {MD011}
|
||||
|
||||
Nor (is this)[z] {MD011}
|
||||
|
||||
[^1]: Footnote
|
||||
[^2]: Another footnote
|
Loading…
Add table
Add a link
Reference in a new issue