From: <Cra...@nt...> - 2005-11-13 13:38:47
|
Author: CrawfordCurrie Date: 2005-11-13 05:35:03 -0800 (Sun, 13 Nov 2005) New Revision: 7443 Modified: twiki/branches/DEVELOP/data/TWiki/TextFormattingRules.txt twiki/branches/DEVELOP/data/TestCases/TestCaseAutoFormatting.txt twiki/branches/DEVELOP/lib/TWiki/Render.pm Log: Item954: add and document obscure bullet extension feature. Modified: twiki/branches/DEVELOP/data/TWiki/TextFormattingRules.txt =================================================================== --- twiki/branches/DEVELOP/data/TWiki/TextFormattingRules.txt 2005-11-13 00:58:12 UTC (rev 7442) +++ twiki/branches/DEVELOP/data/TWiki/TextFormattingRules.txt 2005-11-13 13:35:03 UTC (rev 7443) @@ -10,11 +10,11 @@ <table class="twikiTable"> <tr> -<th> +<th width="50%"> Formatting Command: -</th><th> +</th><th width="25%"> You write: -</th><th> +</th><th width="25%"> You get: </th> </tr> @@ -163,6 +163,23 @@ * back to level 1 </td> </tr> +<tr valign="top"><td> +%H% For all the list types, you can break a list item over several lines by indenting lines after the first one by *at least 3 spaces* e.g. +</td><td> +<verbatim> + * Here is + a bullet + broken over + three lines. +This text is not indented +</verbatim> +</td><td> + * Here is + a bullet + broken over + three lines. +This text is not indented +</td></tr> <tr valign="top"> <td> *Numbered List:* %BR% @@ -173,8 +190,6 @@ | a. | Lowercase letters | a, b, c, d... | | I. | Uppercase Roman Numerals | I, II, III, IV... | | i. | Lowercase Roman Numerals | i, ii, iii, iv... | -%T% If you don't want to cram long text onto one line, wrap it and align continuation lines with leading spaces. - </td><td> <verbatim> 1. Mammals Modified: twiki/branches/DEVELOP/data/TestCases/TestCaseAutoFormatting.txt =================================================================== --- twiki/branches/DEVELOP/data/TestCases/TestCaseAutoFormatting.txt 2005-11-13 00:58:12 UTC (rev 7442) +++ twiki/branches/DEVELOP/data/TestCases/TestCaseAutoFormatting.txt 2005-11-13 13:35:03 UTC (rev 7443) @@ -164,7 +164,7 @@ <ul> <li>level 1 <ul> -<li>level 2 +<li>level 2 and some more </li> </ul> </li> @@ -174,6 +174,7 @@ <!-- actual --> * level 1 * level 2 + and some more <!-- /actual --> </td></tr> <tr><td> Ordered List</td><td> Modified: twiki/branches/DEVELOP/lib/TWiki/Render.pm =================================================================== --- twiki/branches/DEVELOP/lib/TWiki/Render.pm 2005-11-13 00:58:12 UTC (rev 7442) +++ twiki/branches/DEVELOP/lib/TWiki/Render.pm 2005-11-13 13:35:03 UTC (rev 7443) @@ -1129,18 +1129,20 @@ $isList = 0; } elsif ( $line =~ m/^(\t| )+\S/ ) { - $isList = 1; if ( $line =~ s/^((\t| )+)\$\s(([^:]+|:[^\s]+)+?):\s/<dt> $3 <\/dt><dd> / ) { # Definition list $this->_addListItem( \$result, 'dl', 'dd', $1, '' ); + $isList = 1; } elsif ( $line =~ s/^((\t| )+)(\S+?):\s/<dt> $3<\/dt><dd> /o ) { # Definition list $this->_addListItem( \$result, 'dl', 'dd', $1, '' ); + $isList = 1; } elsif ( $line =~ s/^((\t| )+)\* /<li> /o ) { # Unnumbered list $this->_addListItem( \$result, 'ul', 'li', $1, '' ); + $isList = 1; } elsif ( $line =~ m/^((\t| )+)([1AaIi]\.|\d+\.?) ?/ ) { # Numbered list @@ -1153,10 +1155,22 @@ } $line =~ s/^((\t| )+)([1AaIi]\.|\d+\.?) ?/<li$ot> /; $this->_addListItem( \$result, 'ol', 'li', $1, $ot ); + $isList = 1; } + elsif( $isList && $line =~ /^(\t| )+\s*\S/ ) { + # indented line extending prior list item + $result .= $line; + next; + } else { $isList = 0; } + } elsif( $isList && $line =~ /^(\t| )+\s*\S/ ) { + # indented line extending prior list item; case where indent + # starts with is at least 3 spaces or a tab, but may not be a + # multiple of 3. + $result .= $line; + next; } # Finish the list |