whitespace fixes
authorTony Cook <tony@develop-help.com>
Thu, 24 Oct 2013 01:10:20 +0000 (12:10 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 3 Nov 2013 23:20:23 +0000 (10:20 +1100)
site/cgi-bin/modules/DevHelp/Formatter.pm
t/010-modules/050-format.t

index 355c21b6a256bf0a20e3d2fa70f272a032a9d89f..84bad91aab527d6913779b2ccca9c2c510cc33b7 100644 (file)
@@ -449,6 +449,9 @@ sub format {
       #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;
index f0316afe9fa469b9b9276967bc3b08711bcec47f..12e6732eac214614d8849768e761ff4fd4688d4a 100644 (file)
@@ -362,8 +362,10 @@ link[http://foo/|bar
 
 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';
@@ -563,10 +565,12 @@ hello
 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