$text = $with->getNativeData();
if ( $section === '' ) {
+ wfProfileOut( __METHOD__ );
return $with; # XXX: copy first?
} if ( $section == 'new' ) {
# Inserting a new section
$text = $this->getNativeData();
$pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
+ rtrim( $pst );
- return new WikitextContent( $pst );
+ return ( $text === $pst ) ? $this : new WikitextContent( $pst );
}
/**
*
* @param $hasLinks Bool if it is known whether this content contains
* links, provide this information here, to avoid redundant parsing to
- * find out.
- * @param $title null|\Title
+ * find out (default: null).
+ * @param $title Title: (default: null)
*
* @internal param \IContextSource $context context for parsing if necessary
*
*
* @since 1.21
*
- * @param $content Content the content to render
- * @param $title \Title
- * @param $revId null
- * @param $options null|ParserOptions
- * @param $generateHtml bool
+ * @param $title Title
+ * @param $revId int Revision to pass to the parser (default: null)
+ * @param $options ParserOptions (default: null)
+ * @param $generateHtml bool (default: false)
*
* @internal param \IContextSource|null $context
* @return ParserOutput representing the HTML form of the text