use strict;
use warnings;
use Test::Base;
use Text::Hatena::AutoLink;
filters {
text => ['text_hatena_autolink', 'chomp'],
html => ['chomp'],
};
sub text_hatena_autolink {
Text::Hatena::AutoLink->parse(shift);
}
run_is;
__END__
=== http
--- text
http://www.hatena.com/
--- html
http://www.hatena.com/
=== http2
--- text
hatena: http://www.hatena.com/
--- html
hatena: http://www.hatena.com/
=== http3
--- text
hatena: http://www.hatena.com/
hatena(jp): http://www.hatena.ne.jp/
--- html
hatena: http://www.hatena.com/
hatena(jp): http://www.hatena.ne.jp/
=== http_image
--- text
[http://www.hatena.ne.jp/images/top/h1.gif:image]
--- html
=== http_image2
--- text
[http://www.hatena.ne.jp/images/top/h1.gif:image:w150]
--- html
=== http_image3
--- text
[http://www.hatena.ne.jp/images/top/h1.gif:image:h100]
--- html
=== http_title
--- text
This is our site. [http://www.hatena.ne.jp/:title=Hatena]
--- html
This is our site. Hatena
=== ftp
--- text
Here are our files. ftp://www.hatena.ne.jp/
--- html
Here are our files. ftp://www.hatena.ne.jp/
=== unbracket
--- text
I don't want to link to here. []http://dont.link.to.me/[].
--- html
I don't want to link to here. http://dont.link.to.me/.
=== mailto
--- text
send me a mail mailto:info@example.com
--- html
send me a mail mailto:info@example.com