6 class WikitextContentHandler
extends TextContentHandler
{
8 public function __construct( $modelId = CONTENT_MODEL_WIKITEXT
) {
9 parent
::__construct( $modelId, array( CONTENT_FORMAT_WIKITEXT
) );
12 public function unserializeContent( $text, $format = null ) {
13 $this->checkFormat( $format );
15 return new WikitextContent( $text );
19 * @see ContentHandler::makeEmptyContent
23 public function makeEmptyContent() {
24 return new WikitextContent( '' );
29 * Returns a WikitextContent object representing a redirect to the given destination page.
31 * @see ContentHandler::makeRedirectContent
33 * @param Title $destination the page to redirect to.
37 public function makeRedirectContent( Title
$destination ) {
38 $mwRedir = MagicWord
::get( 'redirect' );
39 $redirectText = $mwRedir->getSynonym( 0 ) . ' [[' . $destination->getPrefixedText() . "]]\n";
41 return new WikitextContent( $redirectText );
45 * Returns true because wikitext supports sections.
47 * @return boolean whether sections are supported.
49 public function supportsSections() {
54 * Returns true, because wikitext supports caching using the
55 * ParserCache mechanism.
60 public function isParserCacheSupported() {