How toprealm/mediawiki-extensions-addimgtag works
AddImgTag is a MediaWiki extension that turns <img> markup and {{#img:...}} into HTML images. Its main workflow parses attributes, applies optional domain allow/deny rules, and emits either an image or a notice. A separate, opt-in parser hook normalizes image tags to self-closing form. The README documents the supported capabilities; edges for MediaWiki lifecycle dispatch are dashed where the excerpts do not show extension registration or invocation.
Main entry points: AddImgTagHook.php img tag handler · AddImgParserFunHook.php img parser function · AddImgSelfClosingTag.php Self-closing normalizer
Components 8
Image parsing
- img tag handler
includes/Hooks/AddImgTagHook.php - img parser function
includes/Hooks/AddImgParserFunHook.php
Validation and output
- Attribute builder
includes/Hooks/AddImgTagHook.php - Domain policy
includes/Hooks/AddImgTagHook.php - HTML image or notice
includes/Hooks/AddImgTagHook.php
Content preprocessing
- Self-closing normalizer
includes/Hooks/AddImgSelfClosingTag.php
Other components
- Wiki content
- MediaWiki parser
Connections 13
- Wiki content → MediaWiki parser: provides markup
README.md - img tag handler → MediaWiki parser: registers tag
includes/Hooks/AddImgTagHook.php - img parser function → MediaWiki parser: registers function
includes/Hooks/AddImgParserFunHook.php - MediaWiki parser → img tag handler: dispatches tag
- MediaWiki parser → img parser function: dispatches function
- img tag handler → Attribute builder: builds attributes
includes/Hooks/AddImgTagHook.php - img tag handler → Domain policy: checks domain
includes/Hooks/AddImgTagHook.php - img tag handler → HTML image or notice: emits result
includes/Hooks/AddImgTagHook.php - img parser function → Attribute builder: builds attributes
includes/Hooks/AddImgParserFunHook.php - img parser function → Domain policy: checks domain
includes/Hooks/AddImgParserFunHook.php - img parser function → HTML image or notice: emits result
includes/Hooks/AddImgParserFunHook.php - Self-closing normalizer → MediaWiki parser: registers preprocessing
- MediaWiki parser → Self-closing normalizer: preprocesses content
README.md