JsonContent: Add missing prefix to selector
Change-Id: I977f6c565b93949a310d1207411f893cf83af996
This commit is contained in:
parent
ae3f5f12ff
commit
3535a5f327
3 changed files with 11 additions and 9 deletions
|
|
@ -220,7 +220,7 @@ class JsonContent extends TextContent {
|
|||
return Html::rawElement( 'td', [], $this->arrayTable( $val ) );
|
||||
}
|
||||
|
||||
return Html::element( 'td', [ 'class' => 'value' ], $this->primitiveValue( $val ) );
|
||||
return Html::element( 'td', [ 'class' => 'mw-json-value' ], $this->primitiveValue( $val ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,8 +18,10 @@
|
|||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
/* TODO: Remove this old class once the content caches have cleared */
|
||||
/* stylelint-disable-next-line selector-class-pattern */
|
||||
.mw-json .value,
|
||||
.mw-json-value,
|
||||
.mw-json-single-value {
|
||||
background-color: #dcfae3;
|
||||
font-family: monospace, monospace;
|
||||
|
|
|
|||
|
|
@ -113,27 +113,27 @@ class JsonContentTest extends MediaWikiLangTestCase {
|
|||
],
|
||||
[
|
||||
(object)[ 'foo' ],
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="value">"foo"</td></tr>' .
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="mw-json-value">"foo"</td></tr>' .
|
||||
'</tbody></table>'
|
||||
],
|
||||
[
|
||||
(object)[ 'foo', 'bar' ],
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="value">"foo"</td></tr>' .
|
||||
'<tr><th>1</th><td class="value">"bar"</td></tr></tbody></table>'
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="mw-json-value">"foo"</td></tr>' .
|
||||
'<tr><th>1</th><td class="mw-json-value">"bar"</td></tr></tbody></table>'
|
||||
],
|
||||
[
|
||||
(object)[ 'baz' => 'foo', 'bar' ],
|
||||
'<table class="mw-json"><tbody><tr><th>baz</th><td class="value">"foo"</td></tr>' .
|
||||
'<tr><th>0</th><td class="value">"bar"</td></tr></tbody></table>'
|
||||
'<table class="mw-json"><tbody><tr><th>baz</th><td class="mw-json-value">"foo"</td></tr>' .
|
||||
'<tr><th>0</th><td class="mw-json-value">"bar"</td></tr></tbody></table>'
|
||||
],
|
||||
[
|
||||
(object)[ 'baz' => 1000, 'bar' ],
|
||||
'<table class="mw-json"><tbody><tr><th>baz</th><td class="value">1000</td></tr>' .
|
||||
'<tr><th>0</th><td class="value">"bar"</td></tr></tbody></table>'
|
||||
'<table class="mw-json"><tbody><tr><th>baz</th><td class="mw-json-value">1000</td></tr>' .
|
||||
'<tr><th>0</th><td class="mw-json-value">"bar"</td></tr></tbody></table>'
|
||||
],
|
||||
[
|
||||
(object)[ '<script>alert("evil!")</script>' ],
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="value">"' .
|
||||
'<table class="mw-json"><tbody><tr><th>0</th><td class="mw-json-value">"' .
|
||||
'<script>alert("evil!")</script>"' .
|
||||
'</td></tr></tbody></table>',
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in a new issue