includes/api/ApiExpandTemplates.php 1 location
|
@@ 85-89 (lines=5) @@
|
| 82 |
|
if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) { |
| 83 |
|
$wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS ); |
| 84 |
|
$dom = $wgParser->preprocessToDom( $params['text'] ); |
| 85 |
|
if ( is_callable( [ $dom, 'saveXML' ] ) ) { |
| 86 |
|
$xml = $dom->saveXML(); |
| 87 |
|
} else { |
| 88 |
|
$xml = $dom->__toString(); |
| 89 |
|
} |
| 90 |
|
if ( isset( $prop['parsetree'] ) ) { |
| 91 |
|
unset( $prop['parsetree'] ); |
| 92 |
|
$retval['parsetree'] = $xml; |
includes/api/ApiQueryRevisionsBase.php 1 location
|
@@ 289-293 (lines=5) @@
|
| 286 |
|
Parser::OT_PREPROCESS |
| 287 |
|
); |
| 288 |
|
$dom = $wgParser->preprocessToDom( $t ); |
| 289 |
|
if ( is_callable( [ $dom, 'saveXML' ] ) ) { |
| 290 |
|
$xml = $dom->saveXML(); |
| 291 |
|
} else { |
| 292 |
|
$xml = $dom->__toString(); |
| 293 |
|
} |
| 294 |
|
$vals['parsetree'] = $xml; |
| 295 |
|
} else { |
| 296 |
|
$vals['badcontentformatforparsetree'] = true; |
includes/api/ApiParse.php 1 location
|
@@ 435-439 (lines=5) @@
|
| 432 |
|
|
| 433 |
|
$wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS ); |
| 434 |
|
$dom = $wgParser->preprocessToDom( $this->content->getNativeData() ); |
| 435 |
|
if ( is_callable( [ $dom, 'saveXML' ] ) ) { |
| 436 |
|
$xml = $dom->saveXML(); |
| 437 |
|
} else { |
| 438 |
|
$xml = $dom->__toString(); |
| 439 |
|
} |
| 440 |
|
$result_array['parsetree'] = $xml; |
| 441 |
|
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree'; |
| 442 |
|
} |