The property catalog code (P528) uses qualifer catalog (P972) to specify to which catalog the item belongs to. These catalogs hold their own formatter URLs, so the gadget should be able to find them and link the number accordingly.
Example: Messier 86 (Q2577) has the property with value "M 86" and catalog Messier object (Q14530) which has a formatter the value could be linked by.
Original proposal: https://www.wikidata.org/wiki/MediaWiki_talk:Gadget-AuthorityControl.js#Read_P972