Parsoid
A bidirectional parser between wikitext and HTML5
|
This is an adaptation of the existing ImageMap extension of the legacy parser. More...
Public Member Functions | ||||||||||
getConfig () | ||||||||||
Return information about this extension module.FIXME: Add more expected fields or create a class for this FIXME: The 'name' is expected to be the same as the name defined at the top level of extension.json.
| ||||||||||
sourceToDom (ParsoidExtensionAPI $extApi, string $src, array $extArgs) | ||||||||||
Convert an extension tag's content to DOM.
| ||||||||||
Public Member Functions inherited from Wikimedia\Parsoid\Ext\ExtensionTagHandler | ||||||||||
lintHandler (ParsoidExtensionAPI $extApi, Element $rootNode, callable $defaultHandler) | ||||||||||
Lint handler for this extension. | ||||||||||
domToWikitext (ParsoidExtensionAPI $extApi, Element $node, bool $wrapperUnmodified) | ||||||||||
Serialize a DOM node created by this extension to wikitext. | ||||||||||
modifyArgDict (ParsoidExtensionAPI $extApi, object $argDict) | ||||||||||
Some extensions require the ability to modify the argument dictionary. | ||||||||||
diffHandler (ParsoidExtensionAPI $extApi, callable $domDiff, Element $origNode, Element $editedNode) | ||||||||||
XXX: Experimental. | ||||||||||
This is an adaptation of the existing ImageMap extension of the legacy parser.
Syntax: <imagemap> Image:Foo.jpg | 100px | picture of a foo
rect 0 0 50 50 [[Foo type A]] circle 50 50 20 [[Foo type B]]
desc bottom-left </imagemap>
Coordinates are relative to the source image, not the thumbnail.
Wikimedia\Parsoid\Ext\ImageMap\ImageMap::getConfig | ( | ) |
Return information about this extension module.FIXME: Add more expected fields or create a class for this FIXME: The 'name' is expected to be the same as the name defined at the top level of extension.json.
Implements Wikimedia\Parsoid\Ext\ExtensionModule.
Wikimedia\Parsoid\Ext\ImageMap\ImageMap::sourceToDom | ( | ParsoidExtensionAPI | $extApi, |
string | $src, | ||
array | $extArgs ) |
Convert an extension tag's content to DOM.
ParsoidExtensionAPI | $extApi | |
string | $src | Extension tag content |
array | $extArgs | Extension tag arguments The extension tag arguments should be treated as opaque objects and any necessary inspection should be handled through the API. |
DocumentFragment
if returning some parsed content false
to fallback to the default handler for the content null
to drop the instance completelyReimplemented from Wikimedia\Parsoid\Ext\ExtensionTagHandler.