📄 formatwhitespace.pm
字号:
package Codestriker::Template::Plugin::FormatWhitespace;# Simple template toolkit plugin module for formatting whitespace.use Template::Plugin::Filter;use Codestriker;use base qw( Template::Plugin::Filter );sub filter { my ($self, $text) = @_; # Get the tabwidth setting from the config. my $tabwidth = $self->{ _CONFIG }->{tabwidth}; # Replace newlines with <br>s. $text =~ s/\n/<br>/mgo; # Replace consective spaces with entities. Its important # start start with a leading space, so that the text can be # broken up when it appears inside a floating div or a table row. $text =~ s/ \s+/' ' x (length($&)-1)/emgo; # Replace tabs. $text = Codestriker::tabadjust($tabwidth, $text, 1); return $text;}1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -