Spoilers in Wakaba (16)

1 Name: #!/usr/bin/anonymous : 2011-11-15 16:37 ID:vXrur0sV This thread was merged from the former /code/ board. You can view the archive here.

So I'm trying to add spoiler support in Wakaba, and I'm having a lot of trouble that I think is stemming from regex. I'm new to perl, so this is a bit hard for me. I'm adding the following to sub do_wakabamark($;$$) to accomplish this:

elsif(/^\[spoiler\]/) # spoilers{
if ($lines[0]=~/^\[spoiler\](.*)/){
while !($lines[0]=~/\[\/spoiler\]$/){
push @spoiler,$1; shift @lines;
}
}
$res.="<span class='spoiler'>".(join "<br />",@spoiler)."</span>";
}

Thanks in advance!!

16 Name: #!/usr/bin/anonymous : 2013-03-17 20:49 ID:Heaven

Now you have two problems.

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