In a record I create a new Note (ContentNote object) with the text contained into a custom field. So for that I have to parse the text area of the custom field (string) into a blob (the type of the Content field of the ContentNote object).
Here is what I've done (simplified):
ContentNote cn = new ContentNote(); String body = customeField__c; cn.Content = Blob.valueOf(body.escapeHTML4()); insert cn;
So this code works fine, I add the
escapeHTML4() because I need the escape the characters.
My problem is that the line break are not re-rendered in the ContentNote, when I put a line break in the text area, in the ContentNote I got nothing, and event no space between words.
How can I display the line break into the blob ?