Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub format_comment($)
- {
- my ($comment)=@_;
- # hide >>1 references from the quoting code
- $comment=~s/>>([0-9\-]+)/>gt;$1/g;
- my $handler=sub # fix up >>1 references
- {
- my $line=shift;
- $line=~s!>gt;([0-9]+)!
- my $res=get_post($1);
- if($res) { '<a href="'.get_reply_link($$res{num},$$res{parent}).'" onclick="highlight('.$1.')">>>'.$1.'</a>' }
- else { ">>$1"; }
- !ge;
- $line=~s!>>/([A-z]+)/([0-9]+)#([0-9]+)!
- '<a href="/'.$1.'/res/'.$2.'.html#i'.$3.'">>>/'.$1.'/'.$2.'#'.$3.'</a>'
- !ge;
- return $line;
- };
- #if(ENABLE_WAKABAMARK) { $comment=do_wakabamark($comment,$handler) }
- #else { $comment="<p>".simple_format($comment,$handler)."</p>" }
- $comment=~s!(\r?\n|^)(>.*?)(?=$|\r?\n)!$1<span class="unkfunc">$2</span>$3!g;
- $comment=~s!\r?\n!<br />!g;
- $comment=do_bbcode($comment);
- $comment=$comment=simple_format(do_wakabamark($comment,$handler));
- # fix <blockquote> styles for old stylesheets
- $comment=~s/<blockquote>/<blockquote class="unkfunc">/g;
- # restore >>1 references hidden in code blocks
- $comment=~s/>gt;/>>/g;
- return $comment;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement