1 && imgsInParent[0] !== img) { // 이전 요소가
태그가 아닌 경우에만
추가 var prev = img.previousSibling; while (prev && prev.nodeType === 3 && !prev.textContent.trim()) { prev = prev.previousSibling; } if (!prev || prev.nodeName !== 'BR') { parent.insertBefore(document.createElement('br'), img); } } // 이미지 스타일 강제 적용 img.style.display = 'block'; img.style.margin = '0 auto 20px auto'; img.style.maxWidth = '100%'; img.style.height = 'auto'; img.style.clear = 'both'; }); });