document.querySelectorAll('.expand_image').forEach(img => { const url = img.getAttribute('onclick')?.match(/expand_local\('[^']*','([^']*)'/)?.[1]; url && img.setAttribute('href', url); }); const posts = document.querySelectorAll('.post'); if (posts.length > 1) { const firstComment = posts[1].querySelector('.post_comment'); firstComment && [...posts].slice(1).flatMap(post => [...post.querySelectorAll('.post_image_block')]).forEach(block => firstComment.appendChild(block)); }