Wesley R. Elsberry
Posts: 4991 Joined: May 2002
|
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
|