MediaWiki REL1_35
|
Public Member Functions | |
onParserSectionCreate ( $parser, $section, &$sectionContent, $showEditLinks) | |
This hook is called each time the parser creates a document section from wikitext. | |
Definition at line 11 of file ParserSectionCreateHook.php.
MediaWiki\Hook\ParserSectionCreateHook::onParserSectionCreate | ( | $parser, | |
$section, | |||
& | $sectionContent, | ||
$showEditLinks | |||
) |
This hook is 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.
Parser | $parser | Calling Parser instance |
int | $section | Section number, zero-based, but section 0 is usually empty |
string | &$sectionContent | Reference to the content of the section, which can be modified by the hook |
bool | $showEditLinks | Whether this section has an edit link |
Implemented in MediaWiki\HookContainer\HookRunner.