From ff968c2c5027d41f2e6fce1147e8b6c8d7be9d05 Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Thu, 16 May 2024 18:25:08 +0530 Subject: [PATCH 1/2] Updated distinguishable link evaluate method to pass button links --- lib/checks/color/link-in-text-block-evaluate.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/checks/color/link-in-text-block-evaluate.js b/lib/checks/color/link-in-text-block-evaluate.js index 8494e9a2..7a79eb70 100644 --- a/lib/checks/color/link-in-text-block-evaluate.js +++ b/lib/checks/color/link-in-text-block-evaluate.js @@ -28,6 +28,10 @@ function isBlock(elm) { } function linkInTextBlockEvaluate(node) { + if(node.getAttribute('type') ==='button' || node.tagName.toLowerCase() === 'button' || node.getAttribute('role') !== 'button') { + return true; + } + var options = arguments.length > 1 && arguments[1] ? arguments[1] : {}; if (isBlock(node)) { return false; From d7580f756d1836e9d78ff45888f54b966608cef0 Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Thu, 16 May 2024 18:46:05 +0530 Subject: [PATCH 2/2] Fixed logic for the last commit of distinguishable links --- lib/checks/color/link-in-text-block-evaluate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checks/color/link-in-text-block-evaluate.js b/lib/checks/color/link-in-text-block-evaluate.js index 7a79eb70..67b0731c 100644 --- a/lib/checks/color/link-in-text-block-evaluate.js +++ b/lib/checks/color/link-in-text-block-evaluate.js @@ -28,10 +28,10 @@ function isBlock(elm) { } function linkInTextBlockEvaluate(node) { - if(node.getAttribute('type') ==='button' || node.tagName.toLowerCase() === 'button' || node.getAttribute('role') !== 'button') { + if(node.getAttribute('type') ==='button' || node.tagName.toLowerCase() === 'button' || node.getAttribute('role') === 'button') { return true; } - + var options = arguments.length > 1 && arguments[1] ? arguments[1] : {}; if (isBlock(node)) { return false;