Welcome to the Make community!
I suggest avoid getting GPT to generate HTML-formatted content.
Instead, replace the newlines in plain text using something like this:
<p>{{replace(1.choices[].message.content; "/\n{2,}/g"; "</p><p>")}}</p>
And for tables, you can Text Aggregate each item into rows, and then manually type the HTML code for the table wrapper