mediawiki.jqueryMsg: Fix double-escaped attributes in the parser
authorMatthias Mullie <git@mullie.eu>
Sat, 26 May 2012 00:42:47 +0000 (17:42 -0700)
committermlitn <git@mullie.eu>
Wed, 27 Jun 2012 13:39:50 +0000 (15:39 +0200)
commit5c557e630ab6363cf59ede57976cc025ed0a010d
tree15ef0c8e46d320315083c6b646a76d8827c049f8
parent1e6ed517cdfe02d0141b12c1a275bb72f56f9156
mediawiki.jqueryMsg: Fix double-escaped attributes in the parser

E.g.: message: "Your feedback has been [$1 posted here]."
In mediawiki.jqueryMsg.js, L31, the parser would (rightfully) escape
XML entities in the parameter (a link) being assigned through $1

When actually adding the (already escaped) parameter as href-
attribute of the link-to-be-built, it'll automatically have its HTML
entities escaped once again (thus double-escaping &'s)

This patch will identify regular links and links with replacement-
url's in a different way; now the escaping can be moved to when the
variables are actually being replaced (for normal parameter
replacement) and can be processed differently (= not escaping) when
dealing with a link.

Tests:
 - Removed useless ok() tests. I accidentally introduced that pattern
   last year for no good reason. Slowly getting it out again. It
   either can't return false, or it tests unrelated things that have
   their own tests.
 - Simplified examples to reduce repetition of unrelated strings.
 - Improved assertion titles to better describe what is being tested
   to help find actual problems.
   (e.g. "Neutral from mw.user object" instead of
   "Gender neutral or unknown").

Change-Id: If060b75f5575f4c7c3a25e5280ae697171120e84
resources/mediawiki/mediawiki.jqueryMsg.js
tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js