[livejournal] r17879: LJSUP-7532: Rss and atom for journal bau...
Committer: gariev
LJSUP-7532: Rss and atom for journal baudata don't loadU trunk/cgi-bin/ljfeed.pl
Modified: trunk/cgi-bin/ljfeed.pl
===================================================================
--- trunk/cgi-bin/ljfeed.pl 2010-12-08 08:27:32 UTC (rev 17878)
+++ trunk/cgi-bin/ljfeed.pl 2010-12-08 08:33:27 UTC (rev 17879)
@@ -237,10 +237,15 @@
# do this after clean so we don't have to about know whether or not
# the event is preformatted
if ($u->{'opt_synlevel'} eq 'summary') {
-
# assume the first paragraph is terminated by two <br> or a </p>
# valid XML tags should be handled, even though it makes an uglier regex
- if ($event =~ m!(.*)(((<br\s*/?\>(</br\s*>)?\s*){2})|(</p\s*>))!i) {
+ if ($event =~ m!
+ (.*?) ## any text
+ (?=<) ## followed by "<" (zero-width positive look-ahead assertion)
+ ## and then either </p> or 2 BRs,
+ ## where BR is one of: <br></br>, <br> or <br/>
+ ( (?:<br\s*/?\>(?:</br\s*>)?\s*){2} | (?:</p\s*>) ) !six)
+ {
# everything before the matched tag + the tag itself
# + a link to read more
$event = $1 . $2 . $readmore;
