If the <references> tag is wrapped (e.g. <div><references></div>) and
the first ref on the page contains a newline, Tidy will get confused and
insert extra paragraph breaks in the output.
We can avoid this easily enough by inserting a newline between
MediaWiki:cite_references_prefix and the first reference's <li>.
Note since this changes the output we also have to adjust the parser
tests to expect the new output.
Change-Id: I8222d53eaf2b20f842915fe90af724711a20bfc5
Apparently the initial space in the class name and the double-escaping
of the JSON were both fixed at some point in the past. I haven't tracked
it down, but the change looks beneficial on the face of it.
Change-Id: Ibb30789093bfec8b4e6399e3a97629c6b876a616
This fixes bug 20748 and bug 15819 without breaking the other tests. Reverts r88971.
The conflict with CategoryTree was the old problem of a message being called inside
of a parser callback, this time with clearState for which the hook is global.