54 if ( is_int( $revision ) ) {
55 wfDeprecated( __METHOD__ .
' with integer revision id',
'1.42' );
57 } elseif ( $revision !==
null ) {
58 $revId = $revision->getId();
59 $revTimestamp = $revision->getTimestamp();
61 if ( is_bool( $hints ) ) {
63 $hints = [
'generate-html' => $hints ];
66 $contentHandler = $this->contentHandlerFactory->getContentHandler( $content->
getModel() );
67 $cpoParams =
new ContentParseParams(
71 $hints[
'generate-html'] ??
true,
72 $hints[
'previous-output'] ??
null
75 $parserOutput = $contentHandler->getParserOutput( $content, $cpoParams );
86 if ( !$parserOutput->hasCacheTime() ) {
87 $parserOutput->setCacheTime( $cacheTime );
89 if ( $parserOutput->getRenderId() ===
null ) {
90 $parserOutput->setRenderId( $this->globalIdGenerator->newUUIDv1() );
94 if ( $parserOutput->getCacheRevisionId() ===
null && $revId !==
null ) {
95 $parserOutput->setCacheRevisionId( $revId );
97 if ( $parserOutput->getRevisionTimestamp() ===
null && $revTimestamp !==
null ) {
98 $parserOutput->setRevisionTimestamp( $revTimestamp );
100 return $parserOutput;