[\s\S]*?)
/gim, function(cnt, p1){//alert(p1)
//Распарс спойлеров с медиа
$cnt = $('
'+p1+'
');
var attr = "$(this).toggleClass('visible');$(this).next().toggleClass('visible');$newSpoiler(this);";
var pst_media = $cnt.find('.post-content .spoiler-box:not(.hide-box)').find('img.postimg,iframe,audio,video');
/*подсчет медиаконтента*/ nt+= pst_media.length;
pst_media.each(function(i){
var a = $(this).parents('.spoiler-box:first');
if(a.length){a.addClass('hide-box');
a.children('div["onclick"]')[0].setAttribute('onclick',attr);
if(a.find('.spoiler-box').length==0)a.children('blockquote').html('
');
else $(this).wrap('
');
}
});
return $cnt.html() + b;
});
document.write(str);
}
}());