Template::Plugin::HTML::BBCode - Template Toolkit plugin which


Template-Plugin-HTML-BBCode documentation  | view source Contained in the Template-Plugin-HTML-BBCode distribution.

Index


NAME

Top

Template::Plugin::HTML::BBCode - Template Toolkit plugin which implements wrapper around HTML::BBCode module.

SYNOPSIS

Top

  [%- USE HTML::BBCode -%]
  [% FILTER bbcode %]
  [b]BBCode[/b] - is simple [i]markup language[/i] used in
  [url=http://www.phpbb.com/]phpBB[/url].
  [% END %]

  [%- USE HTML::BBCode( 'bbcode_limited'
    allowed_tags = [ 'b', 'i', 'u' ]
  ) -%]
  [% FILTER bbcode_limited %]
  [b]BBCode[/b] - is simple [i]markup language[/i] used in
  [url=http://www.phpbb.com/]phpBB[/url].
  [% END %]

DESCRIPTION

Top

Template::Plugin::HTML::BBCode - Template Toolkit plugin which implements wrapper around HTML::BBCode module and provides filter for converting BBCode to HTML.

OPTIONS

Top

You can pass positional and named parameters to plugin constructor

Positional parameters

The first and only positional parameter which can be passed to constructor is new name of plugin. For example,

  [%- USE HTML::BBCode( 'bbcode_unlimited' ) -%]

This call would create BBCode-filter with name bbcode_unlimited.

  [% FILTER bbcode_unlimited %] ... BBcoded text ... [% END %]

If this parameter is skipped filter name would be bbcode.

Named parameters

Constructor supports named parameters allowed_tags, html_tags, no_html, linebreaks. These parameters are passed directly to HTML::BBCode constructor.

  [%- USE HTML::BBCode( 'bbcode_limited'
    # allow only italic, underline and bold tags
    allowed_tags = ['i','u','b']
  ) -%]

See HTML::BBCode for more details.

SEE ALSO

Top

Template, HTML::BBCode

AUTHOR

Top

Igor Lobanov, <liol@cpan.org>

http://www.template-toolkit.ru/

COPYRIGHT AND LICENSE

Top


Template-Plugin-HTML-BBCode documentation  | view source Contained in the Template-Plugin-HTML-BBCode distribution.