Parsoid
A bidirectional parser between wikitext and HTML5
|
Simple token transform version of the Ref extension tag. More...
Public Member Functions | |||||||||||||
sourceToDom (ParsoidExtensionAPI $extApi, string $txt, array $extArgs) | |||||||||||||
Convert an extension tag's content to DOM.
| |||||||||||||
lintHandler (ParsoidExtensionAPI $extApi, Element $ref, callable $defaultHandler) | |||||||||||||
Lint handler for this extension.If the extension has lints it wants to expose, it should use $extApi to register those lints. Alternatively, the extension might simply inspect its DOM and invoke the default lint handler on a DOM tree that it wants inspected. For example, <ref> nodes often only have a pointer (the id attribute) to its content, and is lint handler would look up the DOM tree and invoke the default lint handler on that tree.FIXME: There is probably no reason for the lint handler to return anything. The caller should simply proceed with the next sibling of $rootNode after the lint handler returns.
| |||||||||||||
domToWikitext (ParsoidExtensionAPI $extApi, Element $node, bool $wrapperUnmodified) | |||||||||||||
Serialize a DOM node created by this extension to wikitext.
| |||||||||||||
diffHandler (ParsoidExtensionAPI $extApi, callable $domDiff, Element $origNode, Element $editedNode) | |||||||||||||
XXX: Experimental.Call $domDiff on corresponding substrees of $origNode and $editedNode
| |||||||||||||
Public Member Functions inherited from Wikimedia\Parsoid\Ext\ExtensionTagHandler | |||||||||||||
modifyArgDict (ParsoidExtensionAPI $extApi, object $argDict) | |||||||||||||
Some extensions require the ability to modify the argument dictionary. | |||||||||||||
Simple token transform version of the Ref extension tag.
Wikimedia\Parsoid\Ext\Cite\Ref::diffHandler | ( | ParsoidExtensionAPI | $extApi, |
callable | $domDiff, | ||
Element | $origNode, | ||
Element | $editedNode ) |
XXX: Experimental.Call $domDiff on corresponding substrees of $origNode and $editedNode
ParsoidExtensionAPI | $extApi | |
callable | $domDiff | |
Element | $origNode | |
Element | $editedNode |
Reimplemented from Wikimedia\Parsoid\Ext\ExtensionTagHandler.
Wikimedia\Parsoid\Ext\Cite\Ref::domToWikitext | ( | ParsoidExtensionAPI | $extApi, |
Element | $node, | ||
bool | $wrapperUnmodified ) |
Serialize a DOM node created by this extension to wikitext.
ParsoidExtensionAPI | $extApi | |
Element | $node | |
bool | $wrapperUnmodified |
Reimplemented from Wikimedia\Parsoid\Ext\ExtensionTagHandler.
Wikimedia\Parsoid\Ext\Cite\Ref::lintHandler | ( | ParsoidExtensionAPI | $extApi, |
Element | $ref, | ||
callable | $defaultHandler ) |
Lint handler for this extension.If the extension has lints it wants to expose, it should use $extApi to register those lints. Alternatively, the extension might simply inspect its DOM and invoke the default lint handler on a DOM tree that it wants inspected. For example, <ref> nodes often only have a pointer (the id attribute) to its content, and is lint handler would look up the DOM tree and invoke the default lint handler on that tree.FIXME: There is probably no reason for the lint handler to return anything. The caller should simply proceed with the next sibling of $rootNode after the lint handler returns.
ParsoidExtensionAPI | $extApi | |
Element | $rootNode | Extension content's root node |
callable | $defaultHandler | Default lint handler
|
false
to indicate that this extension has no special lint handler (the default lint handler will be used. Return null
to indicate linting should proceed with the next sibling. (Deprecated) A Node
can be returned to indicate the point in the tree where linting should resume.Reimplemented from Wikimedia\Parsoid\Ext\ExtensionTagHandler.
Wikimedia\Parsoid\Ext\Cite\Ref::sourceToDom | ( | ParsoidExtensionAPI | $extApi, |
string | $txt, | ||
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.