Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -33,6 +33,8 @@ |
34 | 34 | var $mExternalLinkTarget; # Target attribute for external links |
35 | 35 | |
36 | 36 | var $mUser; # Stored user object, just used to initialise the skin |
| 37 | + var $mIsPreview; # Parsing the page for a "preview" operation |
| 38 | + var $mIsSectionPreview; # Parsing the page for a "preview" operation on a single section |
37 | 39 | |
38 | 40 | function getUseTeX() { return $this->mUseTeX; } |
39 | 41 | function getUseDynamicDates() { return $this->mUseDynamicDates; } |
— | — | @@ -54,6 +56,8 @@ |
55 | 57 | function getEnableLimitReport() { return $this->mEnableLimitReport; } |
56 | 58 | function getCleanSignatures() { return $this->mCleanSignatures; } |
57 | 59 | function getExternalLinkTarget() { return $this->mExternalLinkTarget; } |
| 60 | + function getIsPreview() { return $this->mIsPreview; } |
| 61 | + function getIsSectionPreview() { return $this->mIsSectionPreview; } |
58 | 62 | |
59 | 63 | function getSkin() { |
60 | 64 | if ( !isset( $this->mSkin ) ) { |
— | — | @@ -99,6 +103,8 @@ |
100 | 104 | function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); } |
101 | 105 | function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); } |
102 | 106 | function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); } |
| 107 | + function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); } |
| 108 | + function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); } |
103 | 109 | |
104 | 110 | function __construct( $user = null ) { |
105 | 111 | $this->initialiseFromUser( $user ); |
— | — | @@ -156,6 +162,8 @@ |
157 | 163 | $this->mEnableLimitReport = false; |
158 | 164 | $this->mCleanSignatures = $wgCleanSignatures; |
159 | 165 | $this->mExternalLinkTarget = $wgExternalLinkTarget; |
| 166 | + $this->mIsPreview = false; |
| 167 | + $this->mIsSectionPreview = false; |
160 | 168 | wfProfileOut( $fname ); |
161 | 169 | } |
162 | 170 | } |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1660,6 +1660,8 @@ |
1661 | 1661 | |
1662 | 1662 | $parserOptions = ParserOptions::newFromUser( $wgUser ); |
1663 | 1663 | $parserOptions->setEditSection( false ); |
| 1664 | + $parserOptions->setIsPreview( true ); |
| 1665 | + $parserOptions->setIsSectionPreview( !is_null($this->section) && $this->section !== '' ); |
1664 | 1666 | |
1665 | 1667 | global $wgRawHtml; |
1666 | 1668 | if ( $wgRawHtml && !$this->mTokenOk ) { |