@@classname@text@@
where classname is the name of a formatting block type and "text" is the text to be included in the block. The text can include line breaks, and other wiki markup is processed within the block.
It's up to the site's CSS stylesheet to format the block; otherwise it will look like normal text.
"classname" => "HTML"
Two placeholders are available in the HTML:
# tarquin: classbox markup use vars qw( %ClassMarkup? );
This next section should go into config. The content of the hash is just an example.
# temp settting %ClassMarkup? = ( "class" => "<div class=\"class\">%text%</div>", "array" => "<div class=\"code\">%text%</div>", "code" => "<div class=\"code\"><nowiki><pre>%text%</pre></nowiki></div>", "quote" => "<div class=\"quote\">%text%</div>", "zip" => "<div class=\"zip\"><a href=\"%text%\">%text%</a></div>" );
$pageText = &QuoteHtml?($pageText);add the following block:
##################### # tarq: classbox markup { my $allkeys = join '|', map quotemeta, keys %ClassMarkup?; # $allkeys = join '|', map quotemeta, keys %ClassMarkup?; #$text =~ s[\@\@($allkeys)\@(.*)\@] [$ClassMarkup?{$1}]eg; $pageText =~ s[\@\@($allkeys)\@(.*?)\@\@] { my $replacement = $ClassMarkup?{$1}; my $blocktext = $2; $replacement =~ s[%text\%] [$blocktext]eg; # process %nowiki% placeholder. # This allows some classes to specify PRE themselves $replacement =~ s[%nowiki%] [\<nowiki\>]g; $replacement =~ s[%/nowiki%] [\<\/nowiki\>]g; $replacement }seg; }