remove carriage return from tagged text
Hello,
I'm trying to tag some items but i'm having some difficulties. I want to tag all paragraphs in a textframe.
I'm doing it as following and thats working like its supposed to:
var paragraphs:Array = indesignTools.getParagraphsForTextFrame(currentTextframe.id);
for (var j:uint = 0 ; j < paragraphs.length ; j++) {
var currentParargraph:Paragraph = paragraphs
; if (currentParargraph.isValid) {
InDesign.app.activeDocument.xmlElements.add("section", currentParagraph);
}
}
Now the problem i'm having is that, if the paragraph has a carriage return at the end, then that carriage return shouldnt get tagged,
so i should end up with a tagged paragraph, NOT including the last carriage return.
How would i have to modify my code so i can tag all paragraphs without the last carriage return?