Page upload: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
| No edit summary | No edit summary | ||
| Line 21: | Line 21: | ||
| <pre> | <pre> | ||
| 			if ( isset( $this->mTagHooks[$name] ) ) { | |||
| 				// @see https://phabricator.wikimedia.org/T4700 | 				// @see https://phabricator.wikimedia.org/T4700 | ||
| 				// @see https://phabricator.wikimedia.org/T3310 | 				// @see https://phabricator.wikimedia.org/T3310 | ||
| Line 27: | Line 28: | ||
| 					$content = $this->internalParse( $content, false, $frame ); | 					$content = $this->internalParse( $content, false, $frame ); | ||
| 				} | 				} | ||
| 				// Note that $content may be null here, for example if the | |||
| 				// tag is self-closed. | |||
| 				$output = call_user_func_array( $this->mTagHooks[$name], | |||
| 					[ $content, $attributes, $this, $frame ] ); | |||
| 			} else { | |||
| </pre> | </pre> | ||
Revision as of 08:27, 5 December 2023
This is the "Page upload" template. It should be called in the following format:
<gallery widths=340px mode="packed-overlay" parse-wikitext>
{{{files}}}
</gallery>
Attention! due to the issue mentioned here:
inner content of tag extensions won't be parsed as wikitext !
In order to allow it in certain circumstances (i.e. within the
tags gallery and ref) we propose
to use the attribute parse-wikitext in conjuction
with the following MW patch:
			if ( isset( $this->mTagHooks[$name] ) ) {
				// @see https://phabricator.wikimedia.org/T4700
				// @see https://phabricator.wikimedia.org/T3310
				if ( !empty( $content )
					&& array_key_exists( 'parse-wikitext', $attributes ) ) {
					$content = $this->internalParse( $content, false, $frame );
				}
				// Note that $content may be null here, for example if the
				// tag is self-closed.
				$output = call_user_func_array( $this->mTagHooks[$name],
					[ $content, $attributes, $this, $frame ] );
			} else {
(includes/parser/Parser.php -> extensionSubstitution )
see also
- https://www.mediawiki.org/wiki/Topic:Vnmqs9jfxz224tz1
- https://www.mediawiki.org/wiki/Extension:TemplateData
- https://www.mediawiki.org/wiki/Topic:Qhj3ybl2rnsiw6oc
- https://phabricator.wikimedia.org/T22707