The self voicing enactor throws error when using UIO+ with wikipedia pages.
To reproduce
Steps to reproduce the behavior:
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;
In a terminal, run "npm run build". Install the built UIO+ in Chrome.
Describe the bug
The self voicing enactor throws error when using UIO+ with wikipedia pages.
To reproduce
Steps to reproduce the behavior:
distributeOptions
block that disables the page level reading in the self voicing component;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 soparsedBlock[0].lang
isundefined
. The reason that an empty array ofparsedBlock
is pushed intothat.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