Currently the only way to add support for a custom type is to add code to the Popups extension (e.g. https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Popups/+/527547/).
Page previews should provide a generic API and a way to register additional code (e.g. https://www.mediawiki.org/wiki/Manual:Extension_registration#Attributes) so that extensions can host their own code.
QA steps
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Dog and hover over links. Preview should display (don't worry if the preview itself says "There was an issue..."
- Hover over a reference link e.g. [8] and check a preview shows with information on reference.
- Click the cog on one of the previews and disable "Enable reference previews" or "Enable previews". both previews should no longer show.