Commit graph

4826 commits

Author SHA1 Message Date
Translation updater bot b26aebf7f3 Localisation updates from https://translatewiki.net.
Change-Id: If9fcbe87f345a878e70b3d9770712e85c229bd38
2015-02-28 22:03:42 +01:00
Marc Ordinas i Llopis dbb4e4b028 T88290: Keep separate content for multiple <ref>s with same name
Change-Id: Iae4dcdb405ce8d233af3105e19bab2b32938ed96
2015-02-27 11:40:04 -08:00
Marc Ordinas i Llopis 5a0abc13b9 T88290: Only output <ref> contents in <references>
Instead of outputting a <ref>'s HTML in both data-mw and in
<references>, output it only in the later and point to it from
data-mw.body.id.

Also preserve data-parsoid for <ref>s text in <references>, as now
that's the only representation of it.

To correctly do html2wt when there are <ref>s inside <references>
we need access to the main document DOM when serializing, so also
ensure that env.page.dom is correctly set (it was only set in v2
before).

Updated tests results and blacklist (some tests now pass).

Change-Id: I0fa7ad692585af19136909bfec39db9868b137c5
2015-02-27 03:14:53 -08: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
Translation updater bot bd37724fd0 Localisation updates from https://translatewiki.net.
Change-Id: I2d4657dd3425db310fcde839fec324180e002556
2015-02-25 22:52:27 +01:00
Translation updater bot d798afe3ce Localisation updates from https://translatewiki.net.
Change-Id: Ib8a544672aaa393ad67f00f60f4ffe37150448a8
2015-02-24 21:58:41 +01:00
Translation updater bot 4e0c0484d6 Localisation updates from https://translatewiki.net.
Change-Id: I5fcf28f39163ef552e71a2d9c3c5fae249988b39
2015-02-21 23:30:35 +01:00
Subramanya Sastry 6e6d3481b6 T90309: Ensure that implicitly-added <references> output have unique ids
* Fixed parser test output of one test to add unique ids. Output for
  other parser tests modified in f528f508 still need fixing up.
  Left for a separate patch.

Change-Id: I04546c2a590930121d960239a1954b26771e9c80
2015-02-20 19:02:45 -06:00
Translation updater bot 4d15f24973 Localisation updates from https://translatewiki.net.
Change-Id: Id64a3a5be405945b2702b6c4d341e1622cca8550
2015-02-20 22:25:49 +01:00
Translation updater bot f00ce1efd2 Localisation updates from https://translatewiki.net.
Change-Id: I616f1cbeb339ea9acecc4aeda53ea232b8ac7c0f
2015-02-19 22:04:27 +01:00
Subramanya Sastry e3bf708b77 Fix output for implicit references for improved html2wt output
* <references /> was not appearing on its own line and was
  instead getting tacked onto previous line of wikitext output.
* Change in blacklisted wt2wt test shows that the new output
  is better.

Change-Id: Ie82401a3bc6082b733339e2456810b6b1c87529a
2015-02-17 17:51:07 +00:00
Translation updater bot f4a96d79e6 Localisation updates from https://translatewiki.net.
Change-Id: I6fd65643440d4e4e78872b0100d54c07b32478c5
2015-02-16 21:51:58 +01:00
Marc Ordinas i Llopis f528f508e8 T88660: Emit reflists for <ref> with no explicit <references>
This patch emits a reflist for all ref groups that still have
<ref>s in them at the end of the document. Currently Cite.php only
does so for the default group. See also T88290.

On html2wt the missing <references> are added to the wikitext,
which makes the wikitext correct. Selser catches this if not part
of the edit.

Change tests to include an explicit <references /> tag, and add
one for explcitly testing that they do get added. This last one
has to be blacklisted as the new <references /> don't appear with
selser.

Change-Id: I79af2c34481cadbf0d68d9571928979adf559b58
2015-02-16 03:16:18 -08:00
Translation updater bot 3ccd1d6385 Localisation updates from https://translatewiki.net.
Change-Id: Iac662e182d2cf6f908dc1d940b306dcf15dcc86b
2015-02-13 22:18:20 +01:00
Chad Horohoe b818a87315 Remove obvious function-level profiling
Change-Id: I435365313846d7529601a2440ea2e3c40a5418f3
2015-02-10 13:53:33 -08:00
Translation updater bot 799a6c4820 Localisation updates from https://translatewiki.net.
Change-Id: I32f88e69738894487f889bdd8a08a9d8b9cebb93
2015-02-10 22:15:02 +01:00
Translation updater bot 201992cfc3 Localisation updates from https://translatewiki.net.
Change-Id: If326f85726f557a1d2668abb34f4d1589d77e7a6
2015-02-02 22:25:29 +01:00
Translation updater bot 5807500e00 Localisation updates from https://translatewiki.net.
Change-Id: I1e187106a53f6cba63bb401e58fbfb1e748ae420
2015-01-25 21:44:06 +01:00
Translation updater bot 7d5392f21a Localisation updates from https://translatewiki.net.
Change-Id: I5b140fa92d5b5dc5c9a2587ad08bc061a571cf47
2015-01-22 23:19:33 +01:00
Translation updater bot bc39bd779e Localisation updates from https://translatewiki.net.
Change-Id: Id6bfa7fbffc01029dbb45b9d0c5f459d02b21f10
2015-01-19 22:00:39 +01:00
Translation updater bot 1ccb9c1bd8 Localisation updates from https://translatewiki.net.
Change-Id: I02bb1e04e513e8e8b9a788a02e128916b517e813
2015-01-18 22:15:58 +01:00
Ricordisamoa a8eba39db0 Fix 'license-name' to match SPDX conventions
References:
http://spdx.org/licenses/
https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name

While 'GPLv2' could mean 'GPLv2 only', the comment at the top of
the file clearly states 'GNU General Public License 2.0 or later'.

Change-Id: I1546f4caef78a17f945c903f2f28d53bf830ca95
2015-01-16 02:11:18 +01:00
Ori Livneh ee4d83a1a7 MWException -> Exception
Change-Id: Ibc0d80f6cb66d96eb1bcb71bb1ee1b097c7878e6
2015-01-09 17:47:47 -08:00
Bryan Davis db56e255d4 Guard against unset array access
From prod error logs:
  Undefined index: 0 in Cite_body.php on line 396
  Undefined index: 1 in Cite_body.php on line 396
  Undefined index: 2 in Cite_body.php on line 396
  Undefined index: 3 in Cite_body.php on line 396
  Undefined index: follow in Cite_body.php on line 396

Change-Id: Id727f2fd7e72d8c4ceb74fdac42885d5c030b4af
2015-01-09 09:09:42 -07:00
Marc Ordinas i Llopis cd8e50acb2 [Cite] Generate the same ids for <ref>s and notes as Cite.php
One particular case is that Cite.php considers equal a name and
its encoding, i.e. "a & b" === "a &amp; b". Added a new test for
this case, but blacklisted it on html2wt, wt2wt and html2html due
to a different problem with how Parsoid encodes entities. This
will be investigated separately, as a simple fix could break
unrelated cases.

Also updated tests and blacklist to the new ids.

Change-Id: I87637a1dc812a3a8f29327b9e6c0040b22a651c4
2015-01-07 11:27:07 +01:00
Translation updater bot e21c7852c6 Localisation updates from https://translatewiki.net.
Change-Id: I04961d4aefa20f2fb7fef7b5ef21e5f03fa843da
2014-12-26 09:43:35 +01:00
Translation updater bot 19570b6cc2 Localisation updates from https://translatewiki.net.
Change-Id: Id677c3230b4fcc8ce86eb389b6c1b988427ee76e
2014-12-23 21:39:14 +01:00
Marc Ordinas i Llopis 3c82fb7787 T58916: Parse extension parameters as plain text
Also encode cite ids properly as now they can contain arbitrary
text. Change in blacklist due to this.

TODO: Investigate if it would be better to do this directly in
the tokenizer.

Change-Id: Ic112124e90d256d73a351d0d57fe3c7546fa065f
2014-12-22 14:02:05 +00:00
Translation updater bot ec6fbe7c3c Localisation updates from https://translatewiki.net.
Change-Id: I2340fdb5e96cbb84eafbf82de6de9b28f70a5709
2014-12-08 23:19:49 +01:00
Arlo Breault 9e6055d547 Fix failures from v2 endpoint
* Although this resolves the crashes, I'm unsatisfied with it as a
   proper fix to the underlying issue. There are many places throughout
   the codebase where we serialize and then parse document fragments
   that should be instrumented to store and unpack data-* attributes.

Bug: T76518
Change-Id: Idca1b0a37ec924a71cb51160d000c7de9717d422
2014-12-02 16:47:32 -08:00
Translation updater bot b5fd2b8d55 Localisation updates from https://translatewiki.net.
Change-Id: Id2d71b538ff839e3086704081af61d99d0165bd5
2014-12-02 22:03:21 +01:00
Translation updater bot 7faf5cde2f Localisation updates from https://translatewiki.net.
Change-Id: Ied781b2216cbad41343f2545c38d6ef443b5e799
2014-11-23 22:39:30 +01:00
Translation updater bot 5045fa3507 Localisation updates from https://translatewiki.net.
Change-Id: I01f97e2989fd64dbe792b2c9fb39c077c3869770
2014-11-13 23:07:00 +01:00
Translation updater bot 9cab73914c Localisation updates from https://translatewiki.net.
Change-Id: I4aca84fc16ec6e62c134c6812ba06ab7ef7c94a3
2014-11-08 22:16:51 +01:00
Translation updater bot bc0995ebe0 Localisation updates from https://translatewiki.net.
Change-Id: I284e28725d49d3f894eb493ef03e660878e06daa
2014-11-02 21:56:48 +01:00
Amir E. Aharoni c9a5b7b1cb Replace == with test for isset and empty string
The coding conventions suggest avoiding ==,
and for this condition definedness is actually more relevant
than whether the string has any text, but since
the string can also be '0', checking for !$text doesn't work.

Similar to I15b422d3345bf4522e68a17dce9682ff28484559 .

Change-Id: Ib823678b639bf4f1a92dffcd9e41c780b56ab128
2014-10-28 19:07:24 +00:00
Amir E. Aharoni 60a0821634 Replace == with isset
The coding conventions suggest avoiding ==,
and for this condition definedness is actually more relevant
than whether the string has any text.

Change-Id: I15b422d3345bf4522e68a17dce9682ff28484559
2014-10-28 19:06:33 +00:00
James D. Forrester 7f10ca97f1 Remove Special:Cite, now moved to its own repository
Change-Id: I6ae358b6855911016793c3227bfc1c04a8637428
2014-10-28 12:02:21 -07:00
Translation updater bot 272cdbb49c Localisation updates from https://translatewiki.net.
Change-Id: I2163747e28e82cea77c316127c3c85beb0a68e14
2014-10-27 20:08:06 +01:00
Subramanya Sastry 8694562ee8 (Bug 57252) Generate HTML5-compliant cite id/about attr values
* Currently, this mimics Cite.php behavior where "a b" and "a_b"
  are considered identical ids.

* Added new parser test.
* Fixed output of another test.
* Fixed section name of a commented out test.

Change-Id: I0c51404c3e659bbddfe9a8909aa6a109d368b762
2014-10-24 17:59:17 -05:00
Amir E. Aharoni 458fb4e705 Replace srting comparison with boolean condition
In this function $text can be both false and empty string.
It is more intuitive to use a boolean operator here than
to rely on the fact that comparing to '' using == happens
to give the correct result.

Change-Id: I08248a3fcade7744287e9b9f3bc176d29ac1ecde
2014-10-01 17:42:18 +03:00
Amir E. Aharoni f85ae02fa9 iEarly return for readability
Change-Id: I80ccb1766b1635c32669818647aad85db95c4866
2014-10-01 17:25:58 +03:00
Amir E. Aharoni 09a1ae5929 Code cleanup for phpcs
Change-Id: I2419c904629e02e1ec4cb24325acd0e2db1297db
2014-09-27 19:56:47 +03:00
Amir E. Aharoni 4840a46c5c Credits for en.json
Change-Id: I4e3674a5dfba5f0cf0b4e0985dca85491b37e359
2014-09-27 19:23:39 +03:00
Amir E. Aharoni d027bc9dfb Convert spaces to tabs in en.json
Change-Id: Ie4d5d097d6b0bbd5b85908be9a7ec745debaea43
2014-09-27 19:20:59 +03:00
Arlo Breault 90c5303678 (Bug 53109) Move data-mw away from manual json attr loading
* This is both faster and consistent with how we're accessing other
   parsoid attributes. It's also a step towards not having this data in
   the html output.

 * Changes to parserTests and the blacklist are for attribute order.

 * Requires upgrading domino to 1.0.18
   https://github.com/fgnass/domino/pull/48

Change-Id: I1edbc260887d480adf04763b15043c374e27cceb
2014-09-27 08:53:22 -07:00
Translation updater bot d45691cb43 Localisation updates from https://translatewiki.net.
Change-Id: I6eaf22336c0895459062162cf47731a9aa140996
2014-09-24 22:13:21 +02:00
Translation updater bot 8a48edee27 Localisation updates from https://translatewiki.net.
Change-Id: I8bfec8822b10d4a4e5f29fd563318c0e61e2391c
2014-09-16 19:41:55 +02:00
Subramanya Sastry 6c503e8973 (Bug 64901) Fix paragraph-wrapping to match PHP parser + Tidy combo
General changes
---------------
* Replaced the hacky 'inBlockNode' parser pipeline option with
  a cleaner 'noPWrapping' option that suppresses paragraph wrapping
  in sub-pipelines (ex: recursive link content, ref tags, attribute
  content, etc.).

Changes to wt2html pipeline
---------------------------
* Fixed paragraph-wrapping code to ensure that there are no bare
  text nodes left behind, but without removing the line-based block-tag
  influences on p-wrapping. Some simplifications as well.

  TODO: There are still some discrepancies around <blockquote>
  p-wrapping behavior. These will be investigated and addressed
  in a future patch.

* Fixed foster parenting code to ensure that fostered content is
  added in p-tags where necessary rather than span-tags.

Changes to html2wt/selser pipeline
----------------------------------
* Fixed DOMDiff to tag mw:DiffMarker nodes with a is-block-node
  attribute when the deleted node is a block node. This is used
  during selective serialization to discard original separators
  between adjacent p-nodes if either of their neighbors is a
  deleted block node.

* Fixed serialization to account for changes to p-wrapping.
  - Updated tag handlers for the <p> tag.
  - Updated separator handling to deal with deleted block tags
    and their influence on separators around adjacent p-tags.
  - Updated selser output code to test whether a deleted block
    tag forces nowiki escaping on unedited content from adjacent
    p-tags.

Changes to parser tests / test setup
------------------------------------
* Tweaked selser test generation to ensure that text nodes are always
  inserted in p-wrappers where necessary.

* Updated parser test output for several tests to introduce p-tags
  instead of span-tags or missing p-tags, add html/parsoid section,
  or in one case, add missing HTML output.

Parser Test Result changes
--------------------------
Newly passing
- 12 wt2html
- 1 wt2wt
- 3 html2html
- 3 html2wt

Newly failing
- 1 html2wt

  "3. Leading whitespace in indent-pre suppressing contexts should not be escaped"
  This is just normalization of output where multiple HTML forms
  serialize to the same wikitext with a newline difference. It is not
  worth the complexity to fix this.

- 1 wt2wt
  ""Trailing newlines in a deep dom-subtree that ends a wikitext line"
  This is again normalization during serialization where an extra
  unnecessary newline is introduced.

- A bunch of selser test changes.
  182 +add, 188 -add => 6 fewer selser failures

  - That is a lot of changes to sift through, and I didn't look at every
    one of those, but a number of changes seem to be harmless, and just
    a change to previously "failing" tests.

  - "Media link with nasty text" test seems to have a lot of selser
    changes, but the HTML generated by Parsoid seems to be "buggy" with
    interesting DSR values as well. That needs investigation separately.

  - "HTML nested bullet list, closed tags (bug 5497) [[3,3,4,[0,1,4],3]]"
    has seen a degradation where a dirty diff got introduced.
    Haven't investigated carefully why that is so.

Change-Id: Ia9c9950717120fbcd03abfe4e09168e787669ac4
2014-09-16 11:59:55 -05:00
Translation updater bot 315449fed7 Localisation updates from https://translatewiki.net.
Change-Id: If975851c5e7194f66f40b8d3fc4fbe2730ee93c9
2014-08-31 21:52:27 +02:00