Exemplo n.º 1
0
 /**
  * Save the parser state required to convert the given half-parsed text to
  * HTML. "Half-parsed" in this context means the output of
  * recursiveTagParse() or internalParse(). This output has strip markers
  * from replaceVariables (extensionSubstitution() etc.), and link
  * placeholders from replaceLinkHolders().
  *
  * Returns an array which can be serialized and stored persistently. This
  * array can later be loaded into another parser instance with
  * unserializeHalfParsedText(). The text can then be safely incorporated into
  * the return value of a parser hook.
  *
  * @param $text string
  *
  * @return array
  */
 function serializeHalfParsedText($text)
 {
     wfProfileIn(__METHOD__);
     $data = array('text' => $text, 'version' => self::HALF_PARSED_VERSION, 'stripState' => $this->mStripState->getSubState($text), 'linkHolders' => $this->mLinkHolders->getSubArray($text));
     wfProfileOut(__METHOD__);
     return $data;
 }
Exemplo n.º 2
0
 /**
  * Save the parser state required to convert the given half-parsed text to
  * HTML. "Half-parsed" in this context means the output of
  * recursiveTagParse() or internalParse(). This output has strip markers
  * from replaceVariables (extensionSubstitution() etc.), and link
  * placeholders from replaceLinkHolders().
  *
  * Returns an array which can be serialized and stored persistently. This
  * array can later be loaded into another parser instance with
  * unserializeHalfParsedText(). The text can then be safely incorporated into
  * the return value of a parser hook.
  *
  * @param string $text
  *
  * @return array
  */
 public function serializeHalfParsedText($text)
 {
     $data = array('text' => $text, 'version' => self::HALF_PARSED_VERSION, 'stripState' => $this->mStripState->getSubState($text), 'linkHolders' => $this->mLinkHolders->getSubArray($text));
     return $data;
 }