I'm trying to write an extension in php that adds certain CSS classes to certain links. I already figured it out how to do it for the mediawiki base, but I don't know how to do that for links that are added by extensions, such as the Flow extension and the Social Profile extension. How do I go about that?