*/
public function clearState() {
$this->firstCallInit();
- $this->mOutput = new ParserOutput;
- $this->mOptions->registerWatcher( [ $this->mOutput, 'recordOption' ] );
+ $this->resetOutput();
$this->mAutonumber = 0;
$this->mIncludeCount = [];
$this->mLinkHolders = new LinkHolderArray( $this );
Hooks::run( 'ParserClearState', [ &$parser ] );
}
+ /**
+ * Reset the ParserOutput
+ */
+ public function resetOutput() {
+ $this->mOutput = new ParserOutput;
+ $this->mOptions->registerWatcher( [ $this->mOutput, 'recordOption' ] );
+ }
+
/**
* Convert wikitext to HTML
* Do not call this function recursively.
return $this->mStripList;
}
+ /**
+ * Get the StripState
+ *
+ * @return StripState
+ */
+ public function getStripState() {
+ return $this->mStripState;
+ }
+
/**
* Add an item to the strip state
* Returns the unique tag which must be inserted into the stripped text
* @param ParserOptions $options
* @param int $outputType
* @param bool $clearState
+ * @param int|null $revId
*/
public function startExternalParse( Title $title = null, ParserOptions $options,
- $outputType, $clearState = true
+ $outputType, $clearState = true, $revId = null
) {
$this->startParse( $title, $options, $outputType, $clearState );
+ if ( $revId !== null ) {
+ $this->mRevisionId = $revId;
+ }
}
/**