package Text::WikiCreole; require Exporter; @ISA = (Exporter); @EXPORT = qw(%creole_tags creole_parse creole_plugin creole_link creole_extend); use vars qw(%creole_tags $VERSION); use strict; use warnings; our $VERSION = "0.01"; # order matters for performance. for inline, first should # be 'plain', second 'esc', last 'any'. the rest in order of most common. my @strict_inline = ( # @inline set to this by default 'plain', 'esc', 'link', 'nlink', 'strong', 'br', 'inowiki', 'img', 'em', 'plug', 'any' ); my @extended_inline = ( # optionally appended to @inline 'sup', 'sub', 'u', 'mono' ); my @strict_blocks = ( # @blocks set to this by default 'p', 'h1', 'h2', 'h3', 'ul', 'ol', 'hr', 'table', 'h4', 'h5', 'h6', 'nowiki', 'plug' ); my @extended_blocks = ( # optionally appended to @blocks 'ip', 'dl' ); # default to strict. switch to extended with creole_extend(1) my @inline = @strict_inline; my @blocks = @strict_blocks; BEGIN { %creole_tags = ( hr => { open => "
", close => "
\n" }, ip => { open => "\n", close => "\n" }, mono => { open => "", close => "" }, h1 => { open => "
Lists:
* unordered list | h1 | h2 |
|---|---|
| c1 | c2 |
** not bold ** ** not bold **
escaped HTML: -> escaped HTML:
test <i> test </i>
}}}
{{{ inline\\also }}} -> inline\\also
Escape Character:
~** not bold ** -> ** not bold **
tilde: ~~ -> tilde: ~
Plugins:
<< plugin >> -> whatever you want
Paragraphs are separated by other blocks and blank lines.
Inline markup can usually be combined, overlapped, etc. List
items and plugin text can span lines.
=head1 EXTENDED MARKUP
In addition to STRICT MARKUP, Text::WikiCreole optionally supports
the following markup:
Inline:
## monospace ## -> monospace
^^ superscript ^^ -> superscript
,, subscript ,, -> subscript
__ underline __ -> underline
(TM) -> ™
(R) -> ®
(C) -> ©
... -> …
-- -> –
Indented Paragraphs:
:this -> this
is indented is indented
:: more indented more
indented
Definition Lists:
; Title ->