# In site init code somewhere use HTML::FromText; my %text2html_options = map ($_=>1) qw(paras blockcode urls email); ... # In preview form command handler if ( $op = "auto-format" ) { $doctext = text2html( $doctext, %text2html_options ); } ... # At bottom of preview page if ( $doctext !~ /\<\w+/ ) { my $markup = text2html( $doctext, %text2html_options ); if ( $doctext ne $markup ) { print "
If the automatic formatting below looks correct, you can apply it with .

$markup"; } } ...