Skip to content

Commit 0eeb5ef

Browse files
committed
fix(rule): filter by startWith ^
1 parent 0df445a commit 0eeb5ef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/textlint-rule-footnote-order.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ const report = (context, options = {}) => {
1111
// Markdown specific type
1212
// It is not documented
1313
["LinkReference"](node) {
14-
if (node.identifier && node.referenceType === "shortcut") {
14+
// ^identifer
15+
if (node.identifier && node.identifier[0] === "^" && node.referenceType === "shortcut") {
1516
shortcuts.push({
1617
node,
1718
identifier: node.identifier
1819
});
1920
}
2021
},
2122
["Definition"](node) {
22-
if (node.identifier) {
23+
if (node.identifier && node.identifier[0] === "^") {
2324
definitions.push({
2425
node,
2526
identifier: node.identifier

test/textlint-rule-footnote-order.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import rule from "../src/textlint-rule-footnote-order";
44
// ruleName, rule, { valid, invalid }
55
tester.run("textlint-rule-footnote-order", rule, {
66
valid: [
7+
`[link] is ignored
8+
9+
[link]: https://example.com`,
710
`valid text.
811
foo [^1].
912
bar [^2].

0 commit comments

Comments
 (0)