Commit graph

69 commits

Author SHA1 Message Date
jenkins-bot d6bc770016 Merge "Change Mediawiki:Cite error ref_no_key text" 2016-02-12 22:49:38 +00:00
darthbhyrava d8775b5450 Change Mediawiki:Cite error ref_no_key text
Clarified error message by changing it to "The opening <ref> tag is malformed or has a bad name".

Bug: T115810
Change-Id: I0c9cb8f5e81ebdb194c57f24a5792b682dd290dc
2016-02-12 22:59:10 +01:00
Petr Matas 216b60cb9a #cite_note and #cite_ref links generated from empty references are broken
Bug: T126241
Change-Id: I1e84d3361424e57e9f115a665f77d686a80a9135
2016-02-12 20:49:43 +00:00
Bartosz Dziewoński e116699480 Rollback all, then redo all, when fixing out-of-order tags; not one-by-one
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
2016-02-02 21:21:30 +01:00
Bartosz Dziewoński 9aa7961c60 Detect duplicate <ref> definitions inside <references> too
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
2015-11-21 11:25:29 +00:00
Bartosz Dziewoński 6c59f47805 Display 'cite_error_references_duplicate_key' next to the affected ref
Follow-up to 5d0fb0309b.

Bug: T114898
Change-Id: Id6d0b7f2c0b76b67a50fc981b9255dff99137bed
2015-10-18 19:44:04 +00:00
Amir E. Aharoni c27317873f Add tests for the follow parameter
Change-Id: Ia939ee6d8bcac0381c4717c6c156d07b8f760f62
2015-10-06 18:39:10 +00:00
eranroz 5d0fb0309b Show an error if a named ref is defined multiple times
Bug: T85386
Change-Id: I6e7a7594628b3e0c09724c11e5d9f650dde25906
2015-09-30 21:27:35 +03:00
Bartosz Dziewoński 0303c2b0b3 Add a parser test for the simplest way to reuse refs
We tested all the corner cases, but never the classic way.

Change-Id: Icbaa7ad5f7491d1ba068a8cc0ec49856201fb963
2015-09-30 15:41:12 +02:00
Amir E. Aharoni b4ca6031ce Fix a test label
The old name was a copy-paste error.

Change-Id: If2771350c0e5e91579488cc9b49e462418b305f1
2015-07-09 17:47:47 +03:00
Amir E. Aharoni d309308e39 Polish parser test titles
* 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
2015-07-08 10:22:56 +00:00
Amir E. Aharoni 1d7efdbe51 Add more tests for edge cases of references without text
Change-Id: Ia6c10419a7a92dac642db6ea21908927a5830b69
2015-07-07 15:16:26 +03:00
Amir E. Aharoni e80ae07f9b Add a test for cite_error_ref_no_input
Change-Id: Ibb3bb1ab3450a34889dcd66b34542f2dd25fdc2b
2015-07-05 12:40:14 +03:00
Amir E. Aharoni 6cfdd6e1a7 Remove spaces from the end of the line
Spaces in the end of the line are usually unnecessary,
and they doesn't seem to do anything useful here.

Change-Id: Ib4d1b72aafd80f36ddf198f3924e5ebbeba79aa5
2015-07-05 12:26:18 +03:00
Bartosz Dziewoński 3f30e08d77 Revert "Do all of Cite's real work during unstrip" and followup
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
2015-06-08 16:24:27 +02:00
Jackmcbarn 944b245428 Do all of Cite's real work during unstrip
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
2015-05-13 02:54:37 +00:00
Brion Vibber 931707fd4a Update parser test case for gallery srcset support
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
2015-02-26 09:59:39 -08:00
Alex Monk 798b453771 If there's no main <references /> block on the page, show one automatically below the content
Rather than showing an error

Bug: 66860
Change-Id: I9c7c13269d5ec355ccb280402aa8c0cedd208883
2014-06-23 22:54:28 +01:00
Nik Everett 635cd3c801 Get parser tests passing again
The failure looks like it was caused by
Ib7aa9449bbd994cb23b83b3f23cff944b1cddadf in core.  Its not a regression,
just different looking equally valid results.

Change-Id: Icfe02eaf7f2a2d8273e973442e04006b6024684d
2014-06-11 14:10:59 -04:00
Marius Hoch 1805cbffec Fix cite parser tests
broken by I82fb4d7 in core

Change-Id: I13b919bb07ee2344a00d64e56593a372a199c5b1
2013-11-03 19:22:45 +01:00
MatmaRex b104717624 Fix parser tests for master MediaWiki core
Caused by I33462a8b in core.

Bug: 52961
Change-Id: I7efa50f4ac86ee732d9ce34fdaa3d8c28179d062
2013-08-17 10:24:29 +00:00
Ed Sanders 4f3f9068b0 Add more specific class to cite errors
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
2013-07-15 01:46:53 +00:00
Platonides d91d8a8f63 Adapt the <gallery> parser test for $wgResponsiveImages
$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
2012-11-26 22:08:11 +01:00
Brad Jorsch e6c76b5d23 (bug 13073) Work around Tidy confusion
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
2012-11-26 19:29:03 +01:00
eranroz da8e6f3b45 Cite anchors should be numbered starting at 1
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
2012-10-18 01:03:31 +02:00
Brad Jorsch 4933d7a682 (bug 17865) Fix wikilinking in "refs without references" error
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
2012-08-07 13:16:46 -04:00
mrbluesky 460275fd4e Follow-up to r111150. Update parsertests, remove item from release notes. 2012-02-10 14:21:45 +00:00
Max Semenik 53ae80785a Follow-up r102160: removed arrows from tooltips 2012-01-04 15:00:01 +00:00
Antoine Musso 2ebda89b06 Bug 31374: regression test made by Brion
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.
2011-12-13 11:16:51 +00:00
Roan Kattouw f0eec14538 Followup r102970, fix parser tests 2011-11-14 12:20:24 +00:00
Ryan Kaldari 5f64b024d4 fixing parser test per r91573 2011-07-06 18:26:51 +00:00
OverlordQ 3b82bbc810 Tweak to r82735, forgot to correct margin 2011-02-24 17:21:01 +00:00
OverlordQ dd663728af Fix Cite parser test for recent gallery changes 2011-02-24 17:11:32 +00:00
Derk-Jan Hartman 4450a9311b Follow up to r77836. Update parserTests for Cite extension due to Gallery change. 2010-12-13 20:35:25 +00:00
Aryeh Gregor 31d5539803 Give image <gallery>s fluid width
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.
2010-11-29 00:11:19 +00:00
Platonides d9b8f32959 Add lists cite_link_label_group-$group to be used for the groups links names.
Fixes bug 22265
2010-05-22 14:28:48 +00:00
OverlordQ 3de4107480 Update parser test to match core wrt thumbnailing (r61777) 2010-02-01 21:44:34 +00:00
Robert Rohde 75004e338f Extends Cite to allows <ref> content to be defined within a <references> block
See comments on Bug 5997, Bug 15724, and discussion at:
 http://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Citing_sources&oldid=304222618#Improving_.3Cref.3E
2009-07-26 22:15:13 +00:00
Remember the dot bb757ec5ba Updated parser test for r52726 and r53287 2009-07-15 04:19:41 +00:00
Aryeh Gregor da56a4b7db Fix parser test broken by r51414 2009-06-05 16:04:19 +00:00
Aryeh Gregor 35593a4bbe Remove superfluous border="0" from images
This should be (and appears to be) handled just fine by CSS.  If it
breaks in any skins, those should have an appropriate CSS rule added.
2009-04-03 14:46:32 +00:00
Aryeh Gregor 245673a16c Don't add empty title attributes to anchor links
All parser tests updated.
2009-03-31 14:26:40 +00:00
Aryeh Gregor 87d06b1ef4 Fix parser test broken by r49020 2009-03-31 14:16:36 +00:00
Alex Z. ca5c36c9b5 (bug 16854) Show an error message when a page has <ref> tags and no <references/>. Patch by Brad Jorsch. 2009-01-26 18:02:28 +00:00
Tim Starling c3048a5e92 Reverting r45379 as per comment 5 on bug 16854, i.e. it doesn't work with section editing. 2009-01-07 13:10:29 +00:00
Chad Horohoe a82380d2a6 (bug 16854) Provide explicit error when <references /> is omitted. Patch by Brad Jorsch. 2009-01-03 18:59:22 +00:00
Siebrand Mazeland 101a9cda45 (bug 44) Rename Image namespace to File. Based on a patch by brion.
* 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
2008-11-17 21:27:00 +00:00
Brion Vibber 340559a0f2 Parser test case for bug 14216
from https://bugzilla.wikimedia.org/attachment.cgi?id=5005
2008-06-20 18:41:14 +00:00
Brion Vibber 27023a48a9 update parser test case results with current message value 2008-04-18 22:48:57 +00:00
Steve Sanbeg 448a99da51 add group option, initialize structures when we start group, clear them when finished 2008-03-21 15:25:26 +00:00