#1 while $part =~ s#(</(?:$all_block_tags)>)(<(?:h[1-6]|$block_tags))#$1\n$2#g;
1 while $part =~ s#</($all_block_tags)><#</$1>\n<#g;
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;
#$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;
quux]
IN
-<a href="http://foo/"><p>bar</p>
-<p>quux</p></a>
+<a href="http://foo/">
+<p>bar</p>
+<p>quux</p>
+</a>
OUT
format_test 'tt[hello]', '<p><tt>hello</tt></p>', 'tt';
format_test 'font[-1|text]', '<p><font size="-1">text</font></p>', 'fontsize';
world]
IN
<hr width="100%" />
-<a href="#foo"><p>hello</p>
+<a href="#foo">
+<p>hello</p>
<p>world</p>
</a>
-<a href="#foo"><p>hello</p>
+<a href="#foo">
+<p>hello</p>
<p>world</p>
</a>
OUT