Last modified: 2007-04-25 21:38:56 UTC
As per the instructions in Semantic's INSTALL file: Edit the file [wikipath]/includes/Parser.php. Insert the line wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text, null ) ); in the method "internalParse" right after the line $text = $this->replaceVariables( $text, $args ); This is the only hack required for full functionality of Semantic MW - everything else is already achievable with existing hooks. I will attach a patch shortly (from revision 20529).
Created attachment 3525 [details] Patch to add hook + documentation Adds InternalParseBeforeLinks as per Semantic's INSTALL instructions.
Comment on attachment 3525 [details] Patch to add hook + documentation Index: docs/hooks.txt =================================================================== --- docs/hooks.txt (revision 20529) +++ docs/hooks.txt (working copy) @@ -388,6 +388,12 @@ $url: string value as output (out parameter, can modify) $query: query options passed to Title::getFullURL() +'InternalParseBeforeLinks': during Parser's internalParse method before links but +after noinclude/includeonly/onlyinclude and other processing. +&$this: Parser object +&$text: string containing partially parsed text +&$this->mStripState: Parser's internal StripState object + 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes &$type: array of strings Index: includes/Parser.php =================================================================== --- includes/Parser.php (revision 20529) +++ includes/Parser.php (working copy) @@ -1000,6 +1000,7 @@ $text = Sanitizer::removeHTMLtags( $text, array( &$this, 'attributeStripCallback' ) ); $text = $this->replaceVariables( $text, $args ); + wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text, &$this->mStripState ) ); // Tables need to come after variable replacement for things to work // properly; putting them before other transformations should keep
Created attachment 3526 [details] Patch to add hook Better patch - now adds documentation in docs/hooks.txt
Created attachment 3527 [details] Patch to add hook with all three params + hooks.txt and RELEASE-NOTES updates Thanks in advance to the dev that can commit this. :)
Fixed in rev 21592