2011/7/14 Leo Koppelkamm diebuche@gmail.com:
( I could do something like $templatesCache = $holders->parent->mTplExpandCache; foreach ( $templatesCache as $template ) { $strp = strpos($template, $line); if ( $strp ) break; }
inside parser->replaceInternalLinks2, L1980, but that's pretty hacky & not really stable either )
$parser->mTplExpandCache holds only the text of template calls without parameters ( eg. {{Foo}} but not {{bar|x|y}} ), so it won't help you much. You could do a separate parse of the article text while skipping the preprocessor. This should give you only the categories that are linked directly from the page. Of course for normal page views this would probably be too expensive, so maybe an API module that you call via AJAX?
HTH,
Paul Copperman