Merge "resources: Provide jquery.i18n (v1.0.3)"
[lhc/web/wiklou.git] / includes / content / TextContent.php
index c3daf83..baea812 100644 (file)
@@ -37,6 +37,7 @@ class TextContent extends AbstractContent {
        /**
         * @param string $text
         * @param string $model_id
+        * @throws MWException
         */
        public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
@@ -132,7 +133,7 @@ class TextContent extends AbstractContent {
         * Returns attempts to convert this content object to wikitext,
         * and then returns the text string. The conversion may be lossy.
         *
-        * @note: this allows any text-based content to be transcluded as if it was wikitext.
+        * @note this allows any text-based content to be transcluded as if it was wikitext.
         *
         * @return string|bool The raw text, or false if the conversion failed.
         */
@@ -160,7 +161,7 @@ class TextContent extends AbstractContent {
                $text = $this->getNativeData();
                $pst = rtrim( $text );
 
-               return ( $text === $pst ) ? $this : new static( $pst );
+               return ( $text === $pst ) ? $this : new static( $pst, $this->getModel() );
        }
 
        /**
@@ -257,7 +258,7 @@ class TextContent extends AbstractContent {
         * This default implementation returns an HTML-escaped version
         * of the raw text content.
         *
-        * @note: The functionality of this method should really be implemented
+        * @note The functionality of this method should really be implemented
         * in getHtml(), and subclasses should override getHtml() if needed.
         * getHighlightHtml() is kept around for backward compatibility with
         * extensions that already override it.