https://bugzilla.wikimedia.org/show_bug.cgi?id=26881

Philippe Elie <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #10 from Philippe Elie <[email protected]> 2011-07-29 17:14:39 UTC ---
hi, I've no working IE to test, but I can reproduce it with Opera 10.

re3 = /^([\s\S]*?)<noinclude>([\s\S]*?)<\/noinclude>/;

here there is two competing non-greedy group, I think FF is right by making the
first one maximal, it's the same case as greedy, if there is choice for
multiple ways to do a match, the match at the same level of greediness must be
maximal from left to right. I guess this is why the comment talk about
lookahead, because with non-greedy competition, match must be moved from right
to left to implement that. The trouble is that Thomas didn't think the same
things can occur with re3 if the page contains more than two
<noinclude></noinclude> sequence. More boring re3 miss a final $ so only a part
of the remaining part is matched and some data are lost.

This works on Opera, by making both group greedy:

re3 = /^([\s\S]*)<noinclude>([\s\S]*)<\/noinclude>\s*$/;

I included too a \s*$ at the end to ensure if we match, we match the whole
data, this way if for some reason the match fail, we will go to the if (m3) {..
} else { pageBody   = m2[2]; pageFooter = ''; } which ensure than no data can
be lost (re2 is terminated by a $). Patch attached, test with IE needed.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to