Add support to MD011 for Markdown Extra-style footnotes (fixes #18).

This commit is contained in:
David Anson 2016-06-24 23:13:00 -07:00
parent cfef715ed3
commit 83639b8ef8
3 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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);
}
});

View 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