Spoilers in Wakaba (16)

7 Name: Mr. Manager!!vBeIv0NZ : 2012-02-03 04:31 ID:rbxt0snr

>>135-141
So I FINALLY got spoilers working properly. I don't remember who told me, but the only way to get this to work without completely rewriting wakabamark was to hold off on the spoiler function until AFTER all wakabamark related things were completed. Anyways, I went ahead and put my code right after:

    # restore >>1 references hidden in code blocks
$comment=~s/&gtgt;/> >/g;

...which was on line 846 in my version of wakaba.pl. Next is the actual spoiler code:

    # new spoiler code (can't put it in 'do_wakabamark' because of 'do_spans' messing with the order of tags
if($comment=~/.*\[spoiler\].*/){
$comment=~s/\[spoiler\]*/\<span class\=\'spoiler\'\>/g;
$comment=~s/\[\/spoiler\]*/\<\/span\>/g;
$comment=~s/\<span class\=\'spoiler\'\>\<br \/\>/\<span class\=\'spoiler\'\>/g;
$comment=~s/\<\/span\>\<br \/\>/\<\/span\>/g;
}

Hopefully this helped -someone- out.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: