BasedOn prop is ignored
yanosh-igor opened this issue · comments
Yanosh Igor commented
BasedOn option is ignored. When I set basedOn to 'letters' it doesn't work. Ir still selects a 'words'.
Here is snipped from code.
key: 'reflow',
value: function reflow(props) {
/* eslint-disable no-control-regex */
var basedOn = props.basedOn || /^[\x00-\x7F]+$/.test(props.text) ? 'words' : 'letters';
switch (basedOn) {
case 'words':
this.units = props.text.split(/\b|(?=\W)/);
break;
case 'letters':
this.units = Array.from(props.text);
break;
default:
throw new Error('Unsupported options basedOn: ' + basedOn);
}
If prop basedOn exists then 'words' will be selected. And it doesn't metter what value basedOn will have.
Could you please fix this issue.