The ContentHandler facility adds support for arbitrary content types on wiki pages, instead of relying on wikitext
-for everything. It was introduced in MediaWiki 1.20.
+for everything. It was introduced in MediaWiki 1.21.
Each kind of content ("content model") supported by MediaWiki is identified by unique name. The content model determines
how a page's content is rendered, compared, stored, edited, and so on.
* text/x-wiki - wikitext
* text/javascript - for js pages
* text/css - for css pages
-* text/plain - for future use, e.g. with some plain-html messages.
-* text/html - for future use, e.g. with some plain-html messages.
+* text/plain - for future use, e.g. with plain text messages.
+* text/html - for future use, e.g. with plain html messages.
* application/vnd.php.serialized - for future use with the api and for extensions
* application/json - for future use with the api, and for use by extensions
* application/xml - for future use with the api, and for use by extensions
These hooks will now trigger a warning when used:
* ArticleAfterFetchContent was replaced by ArticleAfterFetchContentObject
-* ArticleInsertComplete was replaced by ArticleContentInsertComplete
-* ArticleSave was replaced by ArticleContentSave
-* ArticleSaveComplete was replaced by ArticleContentSaveComplete
+* ArticleInsertComplete was replaced by PageContentInsertComplete
+* ArticleSave was replaced by PageContentSave
+* ArticleSaveComplete was replaced by PageContentSaveComplete
* ArticleViewCustom was replaced by ArticleContentViewCustom (also consider a custom implementation of the view action)
* EditFilterMerged was replaced by EditFilterMergedContent
* EditPageGetDiffText was replaced by EditPageGetDiffContent
appropriate serialization and deserialization is handled by the Revision class.
Each revision's content model and serialization format is stored in the revision table (resp. in the archive table, if
-the revision was deleted). The page's (current) content model (that is, the conent model of the latest revision) is also
+the revision was deleted). The page's (current) content model (that is, the content model of the latest revision) is also
stored in the page table.
Note however that the content model and format is only stored if it differs from the page's default, as determined by
There are some changes in behavior that might be surprising to users:
-* Javascript and CSS pages are no longer parsed as wikitext (though pre-safe transform is still applied). Most
+* Javascript and CSS pages are no longer parsed as wikitext (though pre-save transform is still applied). Most
importantly, this means that links, including categorization links, contained in the code will not work.
* With $wgContentHandlerUseDB = false, pages can not be moved in a way that would change the
unsuspecting recipient. This will also cause client-side diffs to fail.
* File pages provide their own action overrides that do not combine gracefully with any custom handlers defined by a
-ContentHandler. If for example a File page used a content model with a custom move action, this would be overridden by
-WikiFilePage's move handler.
+ContentHandler. If for example a File page used a content model with a custom revert action, this would be overridden by
+WikiFilePage's handler for the revert action.