How can I get the text with proper delimiter of multi line text?
mccheung0610 opened this issue · 1 comments
Support Question
How can I get the text with proper delimiter of multi line text?
eg. How
are
you
I tried to use PresentationMLParser.getTextContent but it will return "Howareyou"
Hello @mccheung0610,
What the PresentationMLParser.getTextContent function does is to remove all html tags that are found in the original presentationML, returning only free text.
The example you gave is translated in presentationML as follows:
<p>how</p><p>are</p><p>you</p><p></p>
Being each linebreak an html tag then the returned value from the function is going to automatically remove them.
If you actually need to get all the linebreaks as well I would suggest maybe to parse the presentationML directly instead of extracting it with the PresentationMLParser.