Exception: Clean up html document for error pages
[lhc/web/wiklou.git] / docs / contenthandler.txt
index bb8341f..899554a 100644 (file)
@@ -1,5 +1,5 @@
 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.
@@ -32,17 +32,17 @@ revisions of a page will all have the same content model. Use Revision::getConte
 
 == Architecture ==
 
-Two class hierarchies are used to provide the functionality associated with the different content models: 
+Two class hierarchies are used to provide the functionality associated with the different content models:
 
 * Content interface (and AbstractContent base class) define functionality that acts on the concrete content of a page, and
-* ContentHandler base class provides functionality specific to a content model, but not acting on concrete content. 
+* ContentHandler base class provides functionality specific to a content model, but not acting on concrete content.
 
 The most important function of ContentHandler is to act as a factory for the appropriate implementation of Content. These
 Content objects are to be used by MediaWiki everywhere, instead of passing page content around as text. All manipulation
 and analysis of page content must be done via the appropriate methods of the Content object.
 
 For each content model, a subclass of ContentHandler has to be registered with $wgContentHandlers. The ContentHandler
-object for a given content model can be optained using ContentHandler::getForModelID( $id ). Also Title, WikiPage and
+object for a given content model can be obtained using ContentHandler::getForModelID( $id ). Also Title, WikiPage and
 Revision now have getContentHandler() methods for convenience.
 
 ContentHandler objects are singletons that provide functionality specific to the content type, but not directly acting
@@ -67,8 +67,8 @@ Content serialization formats are identified using MIME type like strings. The f
 * 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
@@ -115,9 +115,9 @@ Besides some functions, some hooks have also been replaced by new versions (see
 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
@@ -131,14 +131,14 @@ Page content is stored in the database using the same mechanism as before. Non-t
 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
 ContentHandler::getDefaultModelFor( $title ). The default values are represented as NULL in the database, to preserve
 space.
 
-Storage of content model and format can be disabled alltogether by setting $wgContentHandlerUseDB = false. In that case,
+Storage of content model and format can be disabled altogether by setting $wgContentHandlerUseDB = false. In that case,
 the page's default model (and the model's default format) will be used everywhere. Attempts to store a revision of a page
 using a model or format different from the default will result in an error.
 
@@ -165,7 +165,7 @@ There are some new globals that can be used to control the behavior of the Conte
 
 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
@@ -180,5 +180,5 @@ provided a specialized handler for the edit action. This is true for the API as
 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.