Skip to content

Commit

Permalink
Allow additional words to be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
khiga8 committed Dec 21, 2022
1 parent 2a8ac8a commit 9bc7f50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion no-generic-link-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
tags: ["accessibility", "links"],
function: function GH002(params, onError) {
// markdown syntax
const allBannedLinkTexts = bannedLinkText.concat(params.config.banned_link_texts || [])
const inlineTokens = params.tokens.filter((t) => t.type === "inline");
for (const token of inlineTokens) {
const { children } = token;
Expand All @@ -40,7 +41,7 @@ module.exports = {
linkText = "";
} else if (type === "link_close") {
inLink = false;
if (bannedLinkText.includes(stripAndDowncaseText(linkText))) {
if (allBannedLinkTexts.includes(stripAndDowncaseText(linkText))) {
onError({
lineNumber,
lineIndex,
Expand Down

0 comments on commit 9bc7f50

Please sign in to comment.