function replaceStars(collection) {
var i, el, re = /^(\s*\*\s*){3}$/;
for(i = 0; i<collection.length; i++) {
el = collection[i];
if( el.innerHTML.match(re)) {
el.insertAdjacentHTML('afterend', '<hr>');
el.parentNode.removeChild(el);
}
}
}
replaceStars(document.querySelectorAll('.entry-content p'));