Nov-03-2016, 02:19 PM
(Nov-03-2016, 01:39 PM)metulburr Wrote: my problem was that i have not been successful at making spoiler html code. All current spoiler tags are handled by the hazSpoiler plugin. And even after looking at the code, im not sure how to replicate it.
Ive tried some custom mycodes such as
https://jsfiddle.net/fy452ct3/3/
i tried somehting like this a bit ago
function my2_nl2br($string){ $cutoff = 250; $string = str_replace("\n", "<br />", $string); if(preg_match_all('/\<pre class="brush: python"\>(.*?)\<\/pre\>/', $string, $match)){ foreach($match as $a){ foreach($a as $b){ $string = str_replace('<pre class="brush: python">'.$b.'</pre>','<pre class="brush: python">'.str_replace("<br />", "\n", $b)."</pre>", $string); if (strlen($b) > $cutoff){ $string = "[spoiler]" . $string . "[/spoiler]"; } } } } return $string; }
Is it working?