mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 12:35:31 +00:00
(DAT-4494) Don't perform replacements on JSON encoded content
This commit is contained in:
parent
8186618eb9
commit
899b127b00
|
@ -144,7 +144,17 @@ class PortableInfoboxParserTagController extends WikiaController {
|
|||
}
|
||||
|
||||
public function replaceMarkers( $text ) {
|
||||
return strtr( $text, $this->markers );
|
||||
global $wgArticleAsJson;
|
||||
if ( $wgArticleAsJson ) {
|
||||
$contentArray = json_decode( $text, true );
|
||||
$text = $contentArray['content'];
|
||||
}
|
||||
$text = strtr( $text, $this->markers );
|
||||
if ( $wgArticleAsJson ) {
|
||||
$contentArray['content'] = $text;
|
||||
$text = json_encode( $contentArray );
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
protected function saveToParserOutput( \ParserOutput $parserOutput, Nodes\NodeInfobox $raw ) {
|
||||
|
|
Loading…
Reference in a new issue