Permalink
Browse files

clean up the list[] construct when unformatting

  • Loading branch information...
1 parent d1132d8 commit 2b8496cbffe887dcf0db0ce8f5d385987cc4e432 @tonycoz committed Jan 20, 2014
Showing with 13 additions and 1 deletion.
  1. +2 −0 site/cgi-bin/modules/DevHelp/Formatter.pm
  2. +11 −1 t/010-modules/050-format.t
@@ -538,6 +538,8 @@ sub remove_format {
and next TRY;
$part =~ s#table\[([^\]\[]+)\|([^\]\[|]+)\]#_cleanup_table($1, "|$2")#ieg
and next TRY;
+ $part =~ s# ?\blist\[([^\]\[\|]*)\|\s*(\S[^\]\[]+)\]#$2#g
+ and next TRY;
$part =~ s#\*\*([^\n]+)#$1#g
and next TRY;
$part =~ s!##([^\n]+)!$1!g
View
@@ -1,6 +1,6 @@
#!perl -w
use strict;
-use Test::More tests => 150;
+use Test::More tests => 151;
sub format_test($$$;$);
sub noformat_test($$$;$);
@@ -868,6 +868,16 @@ OUT
noformat_test '**image[bar]', '', '** list with image content';
noformat_test '%%image[bar]', '', '%% list with image content';
noformat_test '##image[bar]', '', '## list with image content';
+ noformat_test <<IN, <<OUT, "list[] no attr", "both";
+list[|
+## one
+## two
+]
+IN
+ one
+ two
+
+OUT
}
sub format_test ($$$;$) {

0 comments on commit 2b8496c

Please sign in to comment.