Documenting new parser hook, re r92506.
authorIan Baker <raindrift@users.mediawiki.org>
Wed, 20 Jul 2011 17:08:37 +0000 (17:08 +0000)
committerIan Baker <raindrift@users.mediawiki.org>
Wed, 20 Jul 2011 17:08:37 +0000 (17:08 +0000)
This refers to an extension that's not checked in quite yet, FYI

docs/hooks.txt

index 9174351..6ad299a 100644 (file)
@@ -1355,6 +1355,17 @@ $title: title object representing the file
 $file: file object that will be used to create the image
 &$params: 2-D array of parameters
 
+'ParserSectionCreate': Called each time the parser creates a document section
+from wikitext.  Use this to apply per-section modifications to HTML (like
+wrapping the section in a DIV).  Caveat: DIVs are valid wikitext, and a DIV
+can begin in one section and end in another.  Make sure your code can handle
+that case gracefully.  See the EditSectionClearerLink extension for an
+example.
+$this: the calling Parser instance
+$section: the section number, zero-based, but section 0 is usually empty
+&$sectionContent: ref to the content of the section. modify this.
+$showEditLinks: boolean describing whether this section has an edit link
+
 'ParserTestParser': called when creating a new instance of Parser in
 maintenance/parserTests.inc
 $parser: Parser object created