Tripletail
view release on metacpan or search on metacpan
ext/Tripletail-HtmlFilter/HtmlFilter.pm view on Meta::CPAN
my $this = shift;
my $html = shift;
if (not defined $html) {
die __PACKAGE__."#set: ARG[1] is not defined.\n";
}
elsif (ref $html) {
die __PACKAGE__."#set: ARG[1] is a Ref.\n";
}
#@{$this->[HTML]} = split m/(<.+?>)/s, $html;
# âã§ã¯ã<!-- <hoge> -->ãæ£ããè§£æã§ããªããçé¢ç®ã«ãã¼ãºããå¿
è¦ããã
# ããããperlã§çé¢ç®ã«ãã¼ã¶ãæ¸ãã®ã¯é常ã«é¢åãªã®ã§æ£è¦è¡¨ç¾ã§èª¤éåã
# NB: ä»ã«ããæ£ããè§£æã§ããªããã¿ã¼ã³ãåå¨ãããã
@{$this->[HTML]} = split m/((?:<!--.*?-->)|(?:<.+?>))/s, $html;
@{$this->[OUTPUT]} = ();
$this;
}
sub toStr {
my $this = shift;
$this->[CONTEXT]->_flush($this); # æªç¢ºå®ã®é¨åã確å®ãã
join('', map {ref($_)?$_->toStr:$_} @{$this->[OUTPUT]});
lib/Tripletail/InputFilter/SEO.pm view on Meta::CPAN
sub __pairsFromPathInfo {
# æ»ãå¤: ([[key => value], ...], {key => filename, ...})
# ä½ãkey, valueå
±ã«URLãã³ã¼ãããã¦ããäºãæåã³ã¼ãã¯çã®ã¾ã¾ã
my $this = shift;
if(!defined($ENV{PATH_INFO})) {
return ([], undef);
}
my @split = map { $this->_urlDecodeString($_) } split m!/!, $ENV{PATH_INFO};
shift @split; # æåã®é
ç®ã¯å¸¸ã«ç©ºãPATH_INFOãã¹ã©ãã·ã¥ã§å§ã¾ãçºã
my @pairs;
while(@split) {
if(defined($split[0]) && $split[0] eq 'SEO') {
shift(@split);
shift(@split);
next;
}
my $key = shift(@split);
( run in 0.630 second using v1.01-cache-2.11-cpan-71847e10f99 )