Clarified error message by changing it to "The opening <ref> tag is malformed or has a bad name".
Bug: T115810
Change-Id: I0c9cb8f5e81ebdb194c57f24a5792b682dd290dc
Imagine the following wikitext:
<ref name=r/>
<references>
<ref name=r>A</ref>
<ref name=r>B</ref>
</references>
This is simple. Cite would see these as the following operations, in
order:
1. Use only: <ref name=r/>
2. References block
3. Define only: <ref name=r>A</ref>
4. Define only: <ref name=r>B</ref>
<ref name=r> is defined twice with different content and we get an
error message.
Now, imagine the following wikitext:
<ref name=r/>
{{#tag:references|
<ref name=r>A</ref>
<ref name=r>B</ref>
}}
Cite would see these as the following operations, in order:
1. Use only: <ref name=r/>
2. Use and define: <ref name=r>A</ref>
3. Use and define: <ref name=r>B</ref>
4. References block
When the 'references' block appears, Cite notices that the tag has
parsed content, and deduces that it was called with #tag. We need to
undo the last operations to update internal bookkeeping, as the last
two 'ref' tags do not actually represent ref usages, as we assumed,
but only definitions.
5. Undo: <ref name=r> reused
6. Define only: <ref name=r>B</ref>
7. Undo: <ref name=r> defined
(Right now, it appears to Cite that <ref name=r> was never defined!)
8. Define only: <ref name=r>A</ref>
Thus we get no errors, although we should.
This patch changes the order of the rollback operations:
5. Undo: <ref name=r> reused
6. Undo: <ref name=r> defined
7. Define only: <ref name=r>A</ref>
8. Define only: <ref name=r>B</ref>
Aha! <ref name=r> is defined twice with different content! We get an
error correctly.
Bug: T124227
Change-Id: I61766c4104856323987cca9a5e4ff85a76b3618b
For some reason there's an entirely separate function generating the
ref in this case.
This changes the behavior (in addition to adding the error message):
now the contents of the first <ref> with the same name inside
<references> are displayed, not the last. (This was already the case
for <ref>s outside <references>.)
Bug: T116377
Change-Id: I81b64ccd8a2e58f3b25938a63b8ad5967fe2a2c0
* Capitalization of "Chinese"
* Explanation about the usage of Klingon numbers
(the purpose of this test puzzled me until I understood that
"wa'cha' wej", etc., are numerals in the Klingon language).
Change-Id: I81237f98136de2e22b6ff5acc202a668e28b8810
Spaces in the end of the line are usually unnecessary,
and they doesn't seem to do anything useful here.
Change-Id: Ib4d1b72aafd80f36ddf198f3924e5ebbeba79aa5
This reverts commits 944b245428
and fa7be37d15.
These resulted in too many new exciting behaviors for the improvement
of nested refs behavior to be worth it. We should try again later.
Also, use Parser::MARKER_PREFIX instead of $parser->uniqPrefix()
which has been deprecated in the meantime by 12571bde.
Fixes T101390, fixes T100477. Reopens T22707, reopens T18330.
Bug: T100477
Bug: T101390
Change-Id: I1a71854cf24e85697ab171be43eeec9054bc504c
Cite has side effects that currently happen at the same time that the
preprocessor is running. This can cause oddities like references being out
of order, or references showing up in the reference list but never used in
the text. By moving the work to unstrip, only references actually used in
the final text will be present, and the numbering order will always match
the order they were used in the text. This depends on If83b0623 in core.
Change-Id: I0e136f952302b65f1abeeac5273bd842867e1dac
Recent core update to gallery display includes srcset support; one of the
parser test cases for Cite uses a gallery and needs updating to match.
Bug: T64709
Change-Id: I6283415e2f7608d9a5c53bc94804fd95a79d3793
The failure looks like it was caused by
Ib7aa9449bbd994cb23b83b3f23cff944b1cddadf in core. Its not a regression,
just different looking equally valid results.
Change-Id: Icfe02eaf7f2a2d8273e973442e04006b6024684d
Problem:
* VisualEditor needs to be able to more reliably target Cite errors.
Solution:
* Add a more specific class to cite errors
Grumble:
* Ideally all extensions would use mw-ext-{extension name} as a prefix to
their CSS classes (or something similar).
Bug: 51337
Change-Id: If4f5360cc1c7b765ad896b14901a9b024782cc93
$wgResponsiveImages was added and enabled by default in 966cda.
Makes the wiki to use thumb urls in some cases (up to 2x)
where we showed the original before.
Change-Id: I7b399c7d8ef9e47f8cd5c999738ec349e1585777
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
Fix for bug 10537: Cite anchors should be numbered starting at 1
On the way a small refactoring (getting rid of redundant variable)
Change-Id: Iee94917f3f860516cc310d1cdb1c4f9065d40984
The [[MediaWiki:Cite error refs without references]] message does not
correctly display wikilinks. This is because it takes effect during
ParserBeforeTidy, which misses the call to replaceLinkHolders(). And
parsing directly to HTML (with MessageCache::singleton()->parse()) would
lose categories and such added by the error message.
Gerrit change Iaa2755f994edb081eb1d176f632f7add41640dbf adds a
"ParserAfterParse" hook, which can be used to add this message in time
to be correctly handled by replaceLinkHolders().
Change-Id: I093d85d8f8c2ac3238609d145ae5b985602bb3fd
Depends-On: Iaa2755f994edb081eb1d176f632f7add41640dbf
Was originally added by accident with r101522 and lost with r105321.
I add to add a newline before </li>, probably some format changed somewhere.
Added it back just so we do not lost this test.
Bug 3276. Patch by DieBuche, with style cleanups by me, plus a tweak
from comment 27 of the bug to fix spacing. This incidentally removes
the border around galleries, but this was hard to notice anyway, and
could be easily readded if desired. Tested in a few browsers, including
IE6, but more testing and/or input from CSS gurus would be appreciated.
Updates parser tests, including for Cite.
* Parser tests updated. 14 failing parser tests before the change, added one, and the same 14 failing parser tests are remaining
* added namespace aliases for Image and Image_talk for backward compatibility purposes