$aubbc->add_tag( 'tag' => 'Tag', # Tag name: 'type' => '#', # Type number: tag style 'function' => '', # Function: subroutine to expand methods 'message' => 'any', # Message: of tag 'extra' => '', # Extra: of tag 'markup' => '', # Template: output ); #### # This is an example of bold and italic in the same add_tag() # Tags: [b]message[/b] or [i]message[/i] # Output: message or message $aubbc->add_tag( 'tag' => 'b|i', # b or i 'type' => '2', 'function' => '', 'message' => 'any', 'extra' => '', 'markup' => '<%{tag}>%{message}', ); #### sub new_function { # $tag, $message, $attrs are the captured group of its place my ($type, $tag, $message, $markup, $extra, $attrs) = @_; # expand functions.... # A) if there is a $message and blank $markup the $message will replace the tag. # B) if there is both $message and $markup, then $message can be inserted # into $markup if $markup has %{message} or any "Markup Template Tags", # then markup will replace the tag. # C) if both are blank the tag doesnt change. return ($message, $markup); # May have to return more so we have better/more controle } #### # tag: [dd=Stuff 7 attr=33]stuff[/dd] # output:
stuff
$aubbc->add_tag( 'tag' => 'dd', 'type' => '2', 'function' => '', 'message' => 'any', 'extra' => '-|attr/n{20-100},dd/w{7}', 'markup' => '<%{tag} attr="X{attr}" alt="X{dd}">%{message}', ); # tag: [video height=90 width=115]http://www.video.com/video.mp4[/video] # output: $aubbc->add_tag( 'tag' => 'video', 'type' => '2', 'function' => '', 'message' => 'src', 'extra' => '-|width/n{90-120},height/n{60-90}', 'markup' => '', );