document.addEventListener("DOMContentLoaded", function () { // সব article paragraph খুঁজে বের করো document.querySelectorAll("article p").forEach((p) => { // প্রথম child যদি বা হয় const firstElement = p.firstElementChild;if ( firstElement && (firstElement.tagName.toLowerCase() === "strong" || firstElement.tagName.toLowerCase() === "b") ) { // নতুন div তৈরি const wrapper = document.createElement("div"); wrapper.className = "redb";// strong/bold এর content wrapper এর ভিতরে নাও let currentNode = firstElement; let collected = [];while (currentNode) { collected.push(currentNode);// যদি strong/bold tag শেষ হয় তাহলে break if ( currentNode.nodeType === 1 && (currentNode.tagName.toLowerCase() === "strong" || currentNode.tagName.toLowerCase() === "b") ) { // next sibling check let next = currentNode.nextSibling;// যদি next text/plain হয় তাহলে continue if ( next && !(next.nodeType === 1 && (next.tagName.toLowerCase() === "strong" || next.tagName.toLowerCase() === "b")) ) { break; } }currentNode = currentNode.nextSibling; }// collected nodes wrapper এ append collected.forEach((node) => { wrapper.appendChild(node); });// paragraph এর শুরুতে wrapper বসাও p.insertBefore(wrapper, p.firstChild); } }); });