Page MenuHomePhabricator

Cite: Improve compatibility between Parsoid's port and the PHP extension
Open, HighPublic

Description

Error checks that the PHP Cite extension does are not performed in Parsoid's Cite implementation. Here is the list of i18n keys in the Cite extension that serve as proxies for error handling that Parsoid needs to support. As we add support, they will be X'd out.

  • "cite_error_ref_invalid_dir": "Invalid <code>dir=\"$1\"</code>, must be <code>ltr</code> or <code>rtl</code>",
  • "cite_error_ref_numeric_key": "Invalid <ref> tag; name cannot be a simple integer. Use a descriptive title",
  • "cite_error_ref_no_key": "The opening <ref> tag is malformed or has a bad name",
  • "cite_error_ref_too_many_keys": "Invalid <ref> tag; invalid names, e.g. too many",
  • "cite_error_ref_nested_extends": "Extending <ref> tags more than one level deep is not allowed",
  • "cite_error_ref_no_input": "Invalid <ref> tag; refs with no name must have content",
  • "cite_error_references_duplicate_key": "Invalid <ref> tag; name \"$1\" defined multiple times with different content",
  • "cite_error_references_invalid_parameters": "Invalid parameter in <references> tag",
  • "cite_error_references_no_backlink_label": "Ran out of custom backlink labels. Define more in the [[MediaWiki:Cite references link many format backlink labels]] message.",
  • "cite_error_no_link_label_group": "Ran out of custom link labels for group \"$1\". Define more in the [[MediaWiki:$2]] message.",
  • "cite_error_references_no_text": "Invalid <ref> tag; no text was provided for refs named <code>$1</code>",
  • "cite_error_included_ref": "Closing </ref> missing for <ref> tag",
  • "cite_error_included_references": "Closing tag missing for <references>",
  • "cite_error_group_refs_without_references": "<ref> tags exist for a group named \"$1\", but no corresponding <references group=\"$1\"/> tag was found",
  • "cite_error_references_group_mismatch": "<ref> tag in <references> has conflicting group attribute \"$1\".",
  • "cite_error_references_missing_group": "<ref> tag defined in <references> has group attribute \"$1\" which does not appear in prior text.",
  • "cite_error_references_missing_key": "<ref> tag with name \"$1\" defined in <references> is not used in prior text.",
  • "cite_error_references_no_key": "<ref> tag defined in <references> has no name attribute.",
  • "cite_error_empty_references_define": "<ref> tag defined in <references> with name \"$1\" has no content.",

Besides that, Parsoid also needs to address the following missing features.

  • Parsoid does not support the follow arg on ref tags
  • Parsoid doesn't know about special group names like "lower-alpha" etc. and treats them like other group names like "xyz", "books", etc.

Also, please check T221489, T221490, T221491 for additional changes to core Cite that needs to be reflected in Parsoid.


Version: unspecified
Severity: normal

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:47 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz49538.
ssastry created this task.Jun 13 2013, 5:41 PM

[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

Per http://www.mediawiki.org/wiki/Extension:Cite/Cite.php#Merging_two_texts_into_a_single_reference_.28wikisource_issue.29

"<ref name"foo">blablabla</ref> yamamamam <ref follow="foo"><br/>chawachawa</ref>"

should create a single ref with both texts in it

We should also probably try to run upstream's mediawiki/extensions/Cite/citeParserTests.txt.

Note also that bug 2700 seems to have the PST run on the body of the <ref> and <references> tags.

Adding here for visibility: The current patch at https://gerrit.wikimedia.org/r/170936 implements a way to style references and cites using CSS, while leaving a default HTML rendering for older browsers. The only problem right now is how to disable the CSS that makes the compatibility content invisible in browsers that don't support CSS counters. Any help will be appreciated.

ssastry moved this task from In Progress to Needs Triage on the Parsoid board.Mar 3 2015, 9:09 PM
He7d3r added a subscriber: He7d3r.Jul 20 2015, 12:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 20 2015, 12:57 PM
Aklapper removed marcoil as the assignee of this task.Sep 22 2015, 3:38 PM
ssastry updated the task description. (Show Details)May 23 2016, 3:08 PM
ssastry moved this task from Needs Triage to Read Views on the Parsoid board.Jan 11 2018, 9:47 PM
Reedy edited projects, added Parsoid-Read-Views; removed Parsoid.Sep 17 2018, 7:25 PM
Aklapper edited projects, added Parsoid; removed Parsoid-Read-Views.Feb 29 2020, 5:14 PM
ssastry updated the task description. (Show Details)Mar 3 2020, 3:03 PM
ssastry assigned this task to Sbailey.Mar 11 2020, 9:15 PM

Change 584746 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] WIP Fix for Cite extention <ref> with no name and no content

https://gerrit.wikimedia.org/r/584746

Change 587901 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] WIP Adding error trap for cite ref with name but no content

https://gerrit.wikimedia.org/r/587901

Change 584746 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Fix Cite extension <ref> no name and no content error handling

https://gerrit.wikimedia.org/r/584746

Change 601428 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a15

https://gerrit.wikimedia.org/r/601428

Change 601428 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a15

https://gerrit.wikimedia.org/r/601428

Change 604123 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Whitespace only is considered no content

https://gerrit.wikimedia.org/r/604123

Change 604123 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Whitespace only is considered no content

https://gerrit.wikimedia.org/r/604123

Change 605678 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to 0.12.0-a17

https://gerrit.wikimedia.org/r/605678

Catalog of all Cite errors from Core Cite en.json array.

"cite_error": "Cite error: $1",
"cite_error_ref_invalid_dir": "Invalid <code>dir=\"$1\"</code>, must be <code>ltr</code> or <code>rtl</code>",
"cite_error_ref_numeric_key": "Invalid <ref> tag; name cannot be a simple integer. Use a descriptive title",
"cite_error_ref_no_key": "The opening <ref> tag is malformed or has a bad name",
"cite_error_ref_too_many_keys": "Invalid <ref> tag; invalid names, e.g. too many",
"cite_error_ref_nested_extends": "Extending <ref> tags more than one level deep is not allowed",
"cite_error_ref_no_input": "Invalid <ref> tag; refs with no name must have content",
"cite_error_references_duplicate_key": "Invalid <ref> tag; name \"$1\" defined multiple times with different content",
"cite_error_references_invalid_parameters": "Invalid parameter in <references> tag",
"cite_error_references_no_backlink_label": "Ran out of custom backlink labels. Define more in the [[MediaWiki:Cite references link many format backlink labels]] message.",
"cite_error_no_link_label_group": "Ran out of custom link labels for group \"$1\". Define more in the [[MediaWiki:$2]] message.",
"cite_error_references_no_text": "Invalid <ref> tag; no text was provided for refs named <code>$1</code>",
"cite_error_included_ref": "Closing </ref> missing for <ref> tag",
"cite_error_included_references": "Closing tag missing for <references>",
"cite_error_group_refs_without_references": "<ref> tags exist for a group named \"$1\", but no corresponding <references group=\"$1\"/> tag was found",
"cite_error_references_group_mismatch": "<ref> tag in <references> has conflicting group attribute \"$1\".",
"cite_error_references_missing_group": "<ref> tag defined in <references> has group attribute \"$1\" which does not appear in prior text.",
"cite_error_references_missing_key": "<ref> tag with name \"$1\" defined in <references> is not used in prior text.",
"cite_error_references_no_key": "<ref> tag defined in <references> has no name attribute.",
"cite_error_empty_references_define": "<ref> tag defined in <references> with name \"$1\" has no content.",

Change 605678 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to 0.12.0-a17

https://gerrit.wikimedia.org/r/605678

ssastry updated the task description. (Show Details)Tue, Jun 16, 12:12 AM
Sbailey updated the task description. (Show Details)Wed, Jun 17, 5:37 PM
Sbailey updated the task description. (Show Details)Mon, Jun 22, 10:31 PM

Change 587901 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Adding error handling for cite refs with name but no content

https://gerrit.wikimedia.org/r/587901

Change 608437 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a19

https://gerrit.wikimedia.org/r/c/mediawiki/vendor/ /608437

Change 608437 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a19

https://gerrit.wikimedia.org/r/c/mediawiki/vendor/ /608437

Sbailey updated the task description. (Show Details)Wed, Jul 1, 5:06 PM

Change 608745 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] Adding parsoid cite error for name defined but empty or white space

https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/ /608745

Change 608924 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Rename "cite_error_ref_no_text" to "cite_error_references_no_text"

https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/ /608924

Change 608924 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Rename "cite_error_ref_no_text" to "cite_error_references_no_text"

https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/ /608924

Change 608745 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Match core error key for self-closed ref without name

https://gerrit.wikimedia.org/r/608745

Change 609445 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a20

https://gerrit.wikimedia.org/r/609445

Change 609445 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a20

https://gerrit.wikimedia.org/r/609445

Sbailey updated the task description. (Show Details)Wed, Jul 8, 8:31 PM

Change 610409 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] WIP adding "follow" functionality to parsoid cite extension

https://gerrit.wikimedia.org/r/610409