// (add to the coda everything else from the first cluster - e.g. out of order characters)
for (; i < heClusters[0].chars.length; i++) {
coda += heClusters[0].chars[i].text;
}
B/c the meteg gets added to the coda, the next section:
// (add to the nucleus add any shureq or mater - if we haven't already added anything to the coda)
let clusters_processed = 1;
if (coda.length === 0 && heClusters.length > 1 && (heClusters[1].isShureq || heClusters[1].isMater)) {
nucleus += heClusters[1].text;
clusters_processed++;
}
See example:
This is caused by this line:
B/c the meteg gets added to the coda, the next section:
evaluates to false because there is
coda.length