Category: Modules Keywords: textile
Textile 是种 wiki 常用的格式,写起来比较方便。 perlchina wiki 用的就是这个格式。
CPAN 上有个模块为 Text::Textile 可以实现这个功能。于是想着给 Eplanet 增加这功能。
代码还是很简单:
use Text::Textile;
my $textile = Text::Textile->new();
$textile->charset('utf-8');
$c->stash->{cms_text} = $textile->process( $c->stash->{cms_text} );
唯一值得一写的是如果是 utf-8 格式数据的话就得多一句
$textile->charset('utf-8');
Have fun. Enjoy!