clean up another anchor nesting edge case
authorAdrian Oldham <adriann@visualthought.com.au>
Mon, 21 Oct 2013 04:47:33 +0000 (15:47 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 3 Nov 2013 23:20:22 +0000 (10:20 +1100)
site/cgi-bin/modules/DevHelp/Formatter.pm

index 9ae9acc..2ce8d40 100644 (file)
@@ -382,6 +382,7 @@ sub format {
       1 while $part =~ s!</figcaption></p>!</p></figcaption>!g;
       1 while $part =~ s!<p>(<a\s[^>]+>)</p>!$1!g;
       1 while $part =~ s!<p></a></p>!</a>!g;
+      1 while $part =~ s! ?(<a\s[^>]+>)</p>!</p>\n$1!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;