Thread:Project:Support desk/Parse Tag on saving page/reply

Hi!

The hook Manual:Hooks/PageContentSave gives you access to the new page content before it is saved; sounds like where you want to hook in. When you hand its content to a function as shown on the manual page:

public static function onPageContentSave( $wikiPage, $user, $content, $summary, $isMinor, $isWatch, $section, $flags, $status ) { ... }

then you will have the content object in the variable $content. Somehow it surely is possible to get the content of the page out of $content; I think that should work with one of the functions from ContentHandler.php; maybe getContentText. You can then do things with the text content like you can compare it with a string or do a preg_match on some regexp. Basically you can then use all the functions PHP offers to work on strings.