When using LazyApproval I like to include form data in a nicely formatted HTML table in the email so the Approver knows what he or she is approving or rejecting. But I've run into an issue with form data that includes a multi-line rich-text "description" field in which spurious line breaks (<BR />) are added after each <P/> and </LI> tag in the rendering of the email, even though these tags are not in the description field itself.
To be specific, I am storing the following string in a workflow variable called FormattedData:
where the variable TripDescription is the multi-line rich-text field where I have earlier replaced "<" with "<" anf ">" with ">" using fn-Replace in a string builder action.
This is added to the Approver's email in the Task Notification component of a Request Approval action:
For debugging purposes I am capturing the FormattedData variable into a list column and it looks fine. A sample list item looks like this:
which renders in a browser like this:
So there is nothing wrong with the data itself. However, this is how it appears in the email:
and when I do a "View Source" the HTML looks like this:
If you look at the highlighted description field you'll see that the original FormattedData variable, which looked just fine, has been transfromed with lots of <BR /> tags that make it look so ugly in the output.
How to avoid this is the question.