jenkins-bot has submitted this change and it was merged.
Change subject: Add more specific class to cite errors
......................................................................
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
---
M Cite_body.php
M citeParserTests.txt
2 files changed, 12 insertions(+), 12 deletions(-)
Approvals:
Catrope: Looks good to me, approved
Esanders: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/Cite_body.php b/Cite_body.php
index 488bacb..1baec2c 100644
--- a/Cite_body.php
+++ b/Cite_body.php
@@ -1172,7 +1172,7 @@
# We rely on the fact that PHP is okay with passing unused argu-
# ments to functions. If $1 is not used in the message,
wfMessage will
# just ignore the extra parameter.
- $ret = '<strong class="error">' .
+ $ret = '<strong class="error mw-ext-cite-error">' .
wfMessage( 'cite_error', wfMessage( $key, $param
)->plain() )->plain() .
'</strong>';
if ( $parse == 'parse' ) {
diff --git a/citeParserTests.txt b/citeParserTests.txt
index ded8cc1..bf4ebed 100644
--- a/citeParserTests.txt
+++ b/citeParserTests.txt
@@ -10,7 +10,7 @@
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
!! result
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a
href="#cite_note-1">[1]</a></sup>
-<br /><strong class="error">Cite error: <code><ref></code> tags exist,
but no <code><references/></code> tag was found</strong>
+<br /><strong class="error mw-ext-cite-error">Cite error:
<code><ref></code> tags exist, but no <code><references/></code>
tag was found</strong>
</p>
!! end
@@ -142,7 +142,7 @@
{{REVISIONID}}<ref>elite</ref>
!! result
<p>1337<sup id="cite_ref-1" class="reference"><a
href="#cite_note-1">[1]</a></sup>
-<br /><strong class="error">Cite error: <code><ref></code> tags exist,
but no <code><references/></code> tag was found</strong>
+<br /><strong class="error mw-ext-cite-error">Cite error:
<code><ref></code> tags exist, but no <code><references/></code>
tag was found</strong>
</p>
!! end
@@ -253,23 +253,23 @@
<references />
!! result
-<p><strong class="error">Cite error: Invalid <code><ref></code> tag;
+<p><strong class="error mw-ext-cite-error">Cite error: Invalid
<code><ref></code> tag;
name cannot be a simple integer. Use a descriptive title</strong>
</p><p><sup id="cite_ref-1" class="reference"><a
href="#cite_note-1">[1]</a></sup>
-</p><p><strong class="error">Cite error: Invalid <code><ref></code> tag;
+</p><p><strong class="error mw-ext-cite-error">Cite error: Invalid
<code><ref></code> tag;
refs with no content must have a name</strong>
</p><p><sup id="cite_ref-bar_2-0" class="reference"><a
href="#cite_note-bar-2">[2]</a></sup>
</p><p><sup id="cite_ref-blankwithnoreference_3-0" class="reference"><a
href="#cite_note-blankwithnoreference-3">[3]</a></sup>
-</p><p><strong class="error">Cite error: Invalid
<code><references></code> tag;
+</p><p><strong class="error mw-ext-cite-error">Cite error: Invalid
<code><references></code> tag;
parameter "group" is allowed only.
Use <code><references /></code>, or <code><references group="..."
/></code></strong>
</p>
<ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a
href="#cite_ref-1">↑</a></span> <span class="reference-text">Also zero, but
differently! (Normal ref)</span>
</li>
-<li id="cite_note-bar"><span class="mw-cite-backlink"><a
href="#cite_ref-bar_0">↑</a></span> <strong class="error">Cite error: Invalid
<code><ref></code> tag;
+<li id="cite_note-bar"><span class="mw-cite-backlink"><a
href="#cite_ref-bar_0">↑</a></span> <strong class="error
mw-ext-cite-error">Cite error: Invalid <code><ref></code> tag;
no text was provided for refs named <code>bar</code></strong></li>
-<li id="cite_note-blankwithnoreference"><span class="mw-cite-backlink"><a
href="#cite_ref-blankwithnoreference_0">↑</a></span> <strong class="error">Cite
error: Invalid <code><ref></code> tag;
+<li id="cite_note-blankwithnoreference"><span class="mw-cite-backlink"><a
href="#cite_ref-blankwithnoreference_0">↑</a></span> <strong class="error
mw-ext-cite-error">Cite error: Invalid <code><ref></code> tag;
no text was provided for refs named
<code>blankwithnoreference</code></strong></li>
</ol>
@@ -379,12 +379,12 @@
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1">[2
1]</a></sup>
</p>
<ol class="references">
-<li id="cite_note-foo"><span class="mw-cite-backlink"><a
href="#cite_ref-foo_0">↑</a></span> <strong class="error">Cite error: Invalid
<code><ref></code> tag;
+<li id="cite_note-foo"><span class="mw-cite-backlink"><a
href="#cite_ref-foo_0">↑</a></span> <strong class="error
mw-ext-cite-error">Cite error: Invalid <code><ref></code> tag;
no text was provided for refs named <code>foo</code></strong></li>
</ol>
-<p><strong class="error">Cite error: <code><ref></code> tag with name
"unused" defined in <code><references></code> is not used in prior
text.</strong><br />
-<strong class="error">Cite error: <code><ref></code> tag in
<code><references></code> has conflicting group attribute
"1".</strong><br />
-<strong class="error">Cite error: <code><ref></code> tag defined in
<code><references></code> has no name attribute.</strong>
+<p><strong class="error mw-ext-cite-error">Cite error:
<code><ref></code> tag with name "unused" defined in
<code><references></code> is not used in prior text.</strong><br />
+<strong class="error mw-ext-cite-error">Cite error: <code><ref></code>
tag in <code><references></code> has conflicting group attribute
"1".</strong><br />
+<strong class="error mw-ext-cite-error">Cite error: <code><ref></code>
tag defined in <code><references></code> has no name attribute.</strong>
</p>
!! end
--
To view, visit https://gerrit.wikimedia.org/r/73096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If4f5360cc1c7b765ad896b14901a9b024782cc93
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits