Skip to content

Commit 9bc7f50

Browse files
committed
Allow additional words to be configured
1 parent 2a8ac8a commit 9bc7f50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

no-generic-link-text.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
tags: ["accessibility", "links"],
2727
function: function GH002(params, onError) {
2828
// markdown syntax
29+
const allBannedLinkTexts = bannedLinkText.concat(params.config.banned_link_texts || [])
2930
const inlineTokens = params.tokens.filter((t) => t.type === "inline");
3031
for (const token of inlineTokens) {
3132
const { children } = token;
@@ -40,7 +41,7 @@ module.exports = {
4041
linkText = "";
4142
} else if (type === "link_close") {
4243
inLink = false;
43-
if (bannedLinkText.includes(stripAndDowncaseText(linkText))) {
44+
if (allBannedLinkTexts.includes(stripAndDowncaseText(linkText))) {
4445
onError({
4546
lineNumber,
4647
lineIndex,

0 commit comments

Comments
 (0)