function replaceStars(collection) {
const re = /^(\s*\*\s*){3}$/;
collection.forEach((elem) => {
if(elem.innerHTML.match(re)) {
elem.insertAdjacentHTML('afterend', '<hr>');
elem.parentNode.removeChild(elem);
}
});
}
replaceStars(document.querySelectorAll('.entry-content p'));
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'));