Would that be better to use `textDiv.dataset.doIgnore`?

Is this a more performant RegExp `if (/^\s*$/.test(bidiText.str))`?

How about changing the code in the getTextContent function, such that the search string and the string used for the textLayer's div is the same?