@@ -17,7 +17,7 @@ import { normalizeIdentifier } from "micromark-util-normalize-identifier";
1717 * @import { Definition, FootnoteDefinition } from "mdast";
1818 * @import { MarkdownRuleDefinition } from "../types.js";
1919 * @typedef {"duplicateDefinition" | "duplicateFootnoteDefinition" } NoDuplicateDefinitionsMessageIds
20- * @typedef {[{ allowDefinitions?: string[], allowFootnoteDefinitions?: string[] }] } NoDuplicateDefinitionsOptions
20+ * @typedef {[{ allowDefinitions?: string[], allowFootnoteDefinitions?: string[], checkFootnoteDefinitions?: boolean }] } NoDuplicateDefinitionsOptions
2121 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoDuplicateDefinitionsOptions, MessageIds: NoDuplicateDefinitionsMessageIds }> } NoDuplicateDefinitionsRuleDefinition
2222 */
2323
@@ -61,6 +61,9 @@ export default {
6161 } ,
6262 uniqueItems : true ,
6363 } ,
64+ checkFootnoteDefinitions : {
65+ type : "boolean" ,
66+ } ,
6467 } ,
6568 additionalProperties : false ,
6669 } ,
@@ -70,6 +73,7 @@ export default {
7073 {
7174 allowDefinitions : [ "//" ] ,
7275 allowFootnoteDefinitions : [ ] ,
76+ checkFootnoteDefinitions : true ,
7377 } ,
7478 ] ,
7579 } ,
@@ -85,6 +89,7 @@ export default {
8589 normalizeIdentifier ( identifier ) . toLowerCase ( ) ,
8690 ) ,
8791 ) ;
92+ const [ { checkFootnoteDefinitions } ] = context . options ;
8893
8994 /** @type {Map<string, Definition> } */
9095 const definitions = new Map ( ) ;
@@ -119,7 +124,10 @@ export default {
119124 } ,
120125
121126 footnoteDefinition ( node ) {
122- if ( allowFootnoteDefinitions . has ( node . identifier ) ) {
127+ if (
128+ ! checkFootnoteDefinitions ||
129+ allowFootnoteDefinitions . has ( node . identifier )
130+ ) {
123131 return ;
124132 }
125133
0 commit comments