Fix a regression in search highlighting from r90092
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Aug 2011 22:42:57 +0000 (22:42 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Aug 2011 22:42:57 +0000 (22:42 +0000)
commit596a2584b0ea7ca5de24e871e015a9ac03122c3e
tree56cc2a0f36acb8be81d783ee4ef4827c85b4d35e
parent725635dc44bc349a4e263bb8fc1345954a3a6ccf
Fix a regression in search highlighting from r90092

Followup on r94609, r94681 test cases.
This fixes the test case with a period that was failing; problem was not the period, but the space before.
The changed regex in r90092 ended up including the preceding whitespace in the match, so the position of the match was coming up one character before the actual word -- thus offsetting the highlight by one char.

Changed from search to match, using the regex's index property (same as search returns) and adding in the length of the first match component which covers the space/whatever
resources/jquery/jquery.highlightText.js