RSS 2.0 Feed

» Welcome Guest Log In :: Register

Pages: (38) < [1] 2 3 4 5 6 ... >   
  Topic: Board Mechanics< Next Oldest | Next Newest >  
Wesley R. Elsberry



Posts: 4465
Joined: May 2002

(Permalink) Posted: May 11 2006,18:22   

Quote

Wesley, there are problems with nested quotes. Is there a way to fix that?



If it was working before, I don't see how.

From iTextParser.pm:

Quote


$Txt =~ s{\[quote\](.+?)\[\/quote\]}   {
                  $html = do_wrapper({STYLE=>'QUOTE'});
                  qq[<!--QuoteBegin-->$html->{START}<\!--QuoteEBegin-->$1<\!--QuoteEnd-->$html->{END}<\!--QuoteEEnd-->];
                }eisgx;

       $Txt =~ s{\[quote=(.+?),\s*(.+?)\](.+?)\[\/quote\]}   {
                   $auth = $1;
                   $time = $2;
                   $html = do_wrapper({STYLE=>'QUOTE', EXTRA => "($auth \@ $time)"});
                   $extra = "-\-$auth\+$time";
                  qq[<!--QuoteBegin$extra-->$html->{START}<\!--QuoteEBegin-->$3<\!--QuoteEnd-->$html->{END}<\!--QuoteEEnd-->];
                }eisgx;



The regular expression,

\[quote\](.+?)\[\/quote\]

means "look for a quote tag, gather and remember the text from that point to the next closing quote tag". Which means that in any "nested" quote, it matches the outer opening quote tag to the innermost closing quote tag. To do nested quotes, I'm thinking that you would need a real parser, not just some regular expression matches.

Edited by Wesley R. Elsberry on May 12 2006,09:39

--------------
"You can't teach an old dogma new tricks." - Dorothy Parker

    
  1132 replies since Oct. 19 2005,12:45 < Next Oldest | Next Newest >  

Pages: (38) < [1] 2 3 4 5 6 ... >   


Track this topic Email this topic Print this topic

[ Read the Board Rules ] | [Useful Links] | [Evolving Designs]