This script is working almost exactly as I need it, but for one crucial thing.
The processText function uses getTextAttributeIndices() to work out where bold, links, italics etc start and finish in a block of text. That works perfectly on a Text element, but not on a TableCell element.
I have content editors entering content into tables for specific HTML components, which I need to parse and render. But when trying to use this method the console gives me the message:
TypeError: Cannot find function getTextAttributeIndices in object TableCell.
...because there is mo method getTextAttributeIndices for a TableCell. And if I use getText() on my table cell first, I lose the formatting and the indices vanish.
I cannot find a workaround at the moment.
This script is working almost exactly as I need it, but for one crucial thing.
The
processTextfunction usesgetTextAttributeIndices()to work out where bold, links, italics etc start and finish in a block of text. That works perfectly on aTextelement, but not on aTableCellelement.I have content editors entering content into tables for specific HTML components, which I need to parse and render. But when trying to use this method the console gives me the message:
...because there is mo method getTextAttributeIndices for a TableCell. And if I use
getText()on my table cell first, I lose the formatting and the indices vanish.I cannot find a workaround at the moment.