JS DOM and RegEx
Split paragraph in lines.
by Gustavo
HTML
<!DOCTYPE html>
<html>
<head>
<title>Lorem ipsum</title>
</head>
<body>
<h1>Title</h1>
<p>
Echo Three to Echo Seven. Han, old buddy, do you read me? Loud and clear, kid. What's up? Well, I finished my circle. I don't pick up any life readings. There isn't enough life on this ice cube to fill a space cruiser. The sensors are placed. I'm going back...
Oh, no. This ground sure feels strange. It doesn't feel like rock at all. There's an awful lot of moisture in here. I don't know. I have a bad feeling about this. Yeah...
Something's wrong here. No one has seen or knows anything about Threepio. He's been gone too long to have gotten lost... Relax.
It's our only hope. Send all troops in sector twelve to the south slope to protect the fighters. Imperial troops have entered the base. Come on...that's it. Give the evacuation code signal. And get to your transports! K-one-zero...all troops disengage.</p>
</body>
</html>
JavaScript
// Split each new sentence to a separate line in the paragraph text. A sentence can be assumed to be a string of text terminated with a period (.)
const p = document.querySelector("p");
p.innerHTML = p.innerHTML.split(/\.[^.|<]/).join(".</p><p>") + "</p>";