package Kwiki::Autoformat; use strict; use warnings; use Kwiki::Plugin -Base; use Kwiki::Installer -mixin; our $VERSION = 0.03; const class_title => 'Text autoformat'; const class_id => 'autoformat'; sub register { my $registry = shift; $registry->add(wafl => auto => 'Kwiki::Autoformat::Wafl'); $registry->add(wafl => autoformat => 'Kwiki::Autoformat::Wafl'); } package Kwiki::Autoformat::Wafl; use base 'Spoon::Formatter::WaflBlock'; sub to_html { require Text::Autoformat; my $text = Text::Autoformat::autoformat($self->block_text); $text =~ s/\n+//s; return "
$text"; } package Kwiki::Autoformat; __DATA__ =head1 NAME Kwiki::Autoformat - Autoformat preformatted text =head1 SYNOPSIS $ cpan Kwiki::Autoformat $ cd /path/to/kwiki $ echo "Kwiki::Autoformat" >> plugins $ kwiki -update =head1 DESCRIPTION This formats preformatted text using Damian Conway's magical L