JavaScript
1
Вклад в тег
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'));