+
+ # Recursive parsing, escaping and link table handling
+ # Only for HTML output
+ if ( $nowiki && $found && $this->mOutputType == OT_HTML ) {
+ $text = wfEscapeWikiText( $text );
+ } elseif ( $this->mOutputType == OT_HTML && $found ) {
+ # Clean up argument array
+ $assocArgs = array();
+ $index = 1;
+ foreach( $args as $arg ) {
+ $eqpos = strpos( $arg, "=" );
+ if ( $eqpos === false ) {
+ $assocArgs[$index++] = $arg;
+ } else {
+ $name = trim( substr( $arg, 0, $eqpos ) );
+ $value = trim( substr( $arg, $eqpos+1 ) );
+ if ( $value === false ) {
+ $value = "";
+ }
+ if ( $name !== false ) {
+ $assocArgs[$name] = $value;
+ }
+ }
+ }
+
+ # Do not enter included links in link table
+ if ( !is_null( $title ) ) {
+ $wgLinkCache->suspend();
+ }
+
+ # Run full parser on the included text
+ $text = $this->strip( $text, $this->mStripState );
+ $text = $this->internalParse( $text, (bool)$newline, $assocArgs );
+
+ # Add the result to the strip state for re-inclusion after
+ # the rest of the processing
+ $text = $this->insertStripItem( $text, $this->mStripState );
+
+ # Resume the link cache and register the inclusion as a link
+ if ( !is_null( $title ) ) {
+ $wgLinkCache->resume();
+ $wgLinkCache->addLinkObj( $title );
+ }
+ }