Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The self voicing enactor throws error when using UIO+ with wikipedia #43

Open
cindyli opened this issue Dec 20, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@cindyli
Copy link
Member

cindyli commented Dec 20, 2022

Describe the bug

The self voicing enactor throws error when using UIO+ with wikipedia pages.

To reproduce

Steps to reproduce the behavior:

  1. In the UIO+ source code, modify "uioPlus.enactor.selfVoicing" in enactors.js to remove the distributeOptions block that disables the page level reading in the self voicing component;
  2. In a terminal, run "npm run build". Install the built UIO+ in Chrome.
  3. In Chrome, open https://en.wikipedia.org/wiki/Main_Page, turn on text-to-speech, click "play" button;
  4. In the browser console, lang is undefined error is thrown.

Expected behavior

The error should not occur.

Technical details

After a debugging, this error is originated from [this line in Orator.js|https://github.com/fluid-project/infusion/blob/main/src/components/orator/js/Orator.js#L681] because parsedBlock is an empty array so parsedBlock[0].lang is undefined. The reason that an empty array of parsedBlock is pushed into that.parseQueue is from [this block|https://github.com/fluid-project/infusion/blob/main/src/components/orator/js/Orator.js#L572-L574]. On the wikipedia page, many text blocks fit into this condition (lastQueue.length && lastQueue[0].lang !== lang). Those blocks have text but in a different language from what's defined at the page level.

Additional context or notes

This issue is also filed against the infusion at https://issues.fluidproject.org/browse/FLUID-6760

@cindyli cindyli added the bug Something isn't working label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant