jenkins-bot has submitted this change and it was merged.

Change subject: Wrap errors in class=error
......................................................................


Wrap errors in class=error

Change-Id: I80de207c38fab64f9f93bbd92f695abc93958569
---
M includes/Graph.body.php
M tests/parserTests.txt
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Yurik: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Graph.body.php b/includes/Graph.body.php
index c3f8260..75ae23e 100644
--- a/includes/Graph.body.php
+++ b/includes/Graph.body.php
@@ -126,7 +126,7 @@
                $status = FormatJson::parse( $jsonText, FormatJson::TRY_FIXING 
| FormatJson::STRIP_COMMENTS );
                if ( !$status->isOK() ) {
                        $parserOutput->setExtensionData( 'graph_specs_broken', 
true );
-                       return $status->getWikiText();
+                       return "<span 
class=\"error\">{$status->getWikiText()}</span>";
                }
 
                $isInteractive = isset( $args['mode'] ) && $args['mode'] === 
'interactive';
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 428311b..ba0983b 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -30,7 +30,7 @@
 !! result
 <div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" 
data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>
 <div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" 
data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>
-<p>Syntax error
+<p><span class="error">Syntax error</span>
 </p>
 <div class="mw-graph mw-graph-always" style="min-width:200px;min-height:200px" 
data-graph-id="4406ae21fb62ba4a67e041d0f9e026a2819e48a8"></div>
 

-- 
To view, visit https://gerrit.wikimedia.org/r/315833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I80de207c38fab64f9f93bbd92f695abc93958569
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to