1 while $part =~ s#(<(?:$all_block_tags)[^>]*>)(<(?:$all_block_tags)\b)#$1\n$2#g;
1 while $part =~ s#(</a>)(<a\s+[^>]*>)(<(?:$all_block_tags))#$1\n$2\n$3#g;
1 while $part =~ s#(<a\s+[^>]*>)(<(?:$all_block_tags))#$1\n$2#g;
- 1 while $part =~ s#(<hr\b[^>]*/>)(<a\s+[^>]*>)#$1\n$2#g;
+ 1 while $part =~ s#(>)(<hr\b[^>]*/>)#$1\n$2#g;
+ 1 while $part =~ s#(<hr\b[^>]*/>)(<)#$1\n$2#g;
#$part =~ s!<p>(<hr[^>]*>)</p>!$1!g;
$part =~ s!<p>(<(?:table|ol|ul|center|h[1-6])[^>]*>)!$1!g;
$part =~ s!(</(?:table|ol|ul|center|h[1-6])>)</p>!$1!g;
#!perl -w
use strict;
-use Test::More tests => 141;
+use Test::More tests => 142;
sub format_test($$$;$);
sub noformat_test($$$;$);
format_test 'hr[]', '<hr />', 'hr0';
format_test 'hr[80%]', '<hr width="80%" />', 'hr1';
format_test 'hr[80%|10]', '<hr width="80%" size="10" />', 'hr2';
+ format_test <<'IN', <<'OUT', 'hr with other text', 'both';
+testhr[]test
+hr[80%]
+test
+IN
+<p>test</p>
+<hr />
+<p>test</p>
+<hr width="80%" />
+<p>test</p>
+OUT
format_test <<IN, <<OUT, 'table1', 'both';
table[80%
bgcolor="black"|quux|blarg