same-caption-summary-evaluate.js 394 B

123456789101112
  1. import { accessibleText } from '../../commons/text';
  2. function sameCaptionSummaryEvaluate(node) {
  3. // passing node.caption to accessibleText instead of using
  4. // the logic in accessibleTextVirtual on virtualNode
  5. return (
  6. !!(node.summary && node.caption) &&
  7. node.summary.toLowerCase() === accessibleText(node.caption).toLowerCase()
  8. );
  9. }
  10. export default sameCaptionSummaryEvaluate;