JSFiddle - React, Tailwind, and code Playground
by Derek Leung
HTML
<div id="story">
This is a paragraph.
This is another paragraph.
</div>
JavaScript
var text = document.querySelector("#story").childNodes[0].wholeText;
var paragraphs = text.split(/\n\s*\n/);
document.querySelector("#story").innerText = "";
for(var i = 0; i < paragraphs.length; i++){
var p = document.createElement("p");
p.innerHTML = paragraphs[i];
document.querySelector("#story").appendChild(p);
}