Index: TWiki.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v retrieving revision 1.259 diff -U3 -r1.259 TWiki.pm --- TWiki.pm 19 Jan 2004 16:24:35 -0000 1.259 +++ TWiki.pm 20 Jan 2004 06:08:35 -0000 @@ -2881,11 +2984,56 @@ } # Lists and paragraphs - s/^\s*$/

/o && ( $isList = 0 ); - m/^(\S+?)/o && ( $isList = 0 ); + + if (1) { # Commented out + # Original code + + # Paragraph + s/^\s*$/

/o && ( $isList = 0 ); + + # Get out of list mode if not indented line + m/^\S+?/o && ( $isList = 0 ); + + } else { + # FIXME: Need to distinguish between paras starting with + # HTML for emphasis or link, vs. paras that are really all + # custom HTML. Blank lines need to drive things more - + # maybe queue lines until a blank line is seen that + # triggers rendering of the whole para? + + # FIXME: Need to call getRenderedVersion in non-paragraph + # mode for all except the topic text. + + # Detect start of paragraph and emit HTML - not in paragraph or + # list, and current line is not indented and doesn't start + # with HTML or '#' or '%'. + if( not $isList and not $isPara + and m/^./ and not m/^[ \t<#%]/ ) { + writeDebug "Para start: $_"; + $isPara = 1; + s!^!

!; + $isList = 0; + # FIXME: also do this at start of loop + } + # Detect end of paragraph and emit HTML - already in paragraph, + # not in list, and current line is blank. + if( not $isList and $isPara and m/^\s*$/o ) { + writeDebug "Para end: $_"; + $isPara = 0; + s!!

!; + $isList = 0; + # FIXME: also do this at end of loop + } + } # commented out + + # Definition list s/^(\t+)(\S+?):\s/
$2<\/dt>
/o && ( $result .= &emitList( "dl", "dd", length $1 ) ); + # Unnumbered list s/^(\t+)\* /
  • /o && ( $result .= &emitList( "ul", "li", length $1 ) ); + # Numbered list s/^(\t+)([1AaIi]\.|\d+\.?) ?/
  • /o && ( $result .= &emitList( "ol", "li", length $1, $2 ) ); + + # Finish list ($isList could be reset by emitList...) if( ! $isList ) { $result .= &emitList( "", "", 0 ); $isList = 0;