Add Ignore Selector and Skip Hidden Content options

Created on 31 May 2023, over 1 year ago
Updated 6 November 2023, about 1 year ago

Problem/Motivation

In certain scenarios, we might want to ignore some content from being read, typically hidden and/or duplicated content in the DOM.

Proposed resolution

The ReadSpeaker API provides 2 interesting options to :

The table of JavaScript option looks like :

      window.rsConf = {
        general: {
          skipHiddenContent: drupalSettings.readSpeaker.skipHiddenContent,
          usePost: drupalSettings.readSpeaker.usePost,
          labels: {
            ignoreSelector: drupalSettings.readSpeaker.ignoreSelector ? prepareIgnoreSelectorString(drupalSettings.readSpeaker.ignoreSelector) : false,
          },
        },
      };

Merge Request to follow with one common JavaScript file to handle all the global options and ease the addition of new parameters.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia GuillaumeG

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024