I am trying to post a comment that includes newlines to a pull request using https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments
My request body looks like this:
{"content":{"raw":"Report\nTotal Files Examined: 20\nLooks Good!"}}I would expect the UI comment to look like this:
Report
Total Files Examined: 20
Looks Good!
The request is accepted, but the output in the pull request looks like this:
Report Total Files Examined: 20 Looks Good!
If I open the HTML of the PR page, I see the following:
<p>Report
Total Files Examined: 20
Looks Good!</p>
I believe what is happening is that the raw content is always being pasted into the <p> tags, but what *should* happen is every newline is converted into a new <p> tag.
I have also tried using \\n and <br>, \\n turns into this in the UI
Report\nTotal Files Examined: 20\nLooks Good!
and <br> turns into this:
Report<br>Total Files Examined: 20<br>Looks Good!
Is there any way around this? I need to UI to respect the line breaks somehow.