Index: trunk/phase3/includes/CoreParserFunctions.php |
— | — | @@ -221,6 +221,13 @@ |
222 | 222 | return ''; |
223 | 223 | } |
224 | 224 | $tagName = strtolower( trim( $frame->expand( array_shift( $args ) ) ) ); |
| 225 | + |
| 226 | + if ( count( $args ) ) { |
| 227 | + $inner = $frame->expand( array_shift( $args ) ); |
| 228 | + } else { |
| 229 | + $inner = null; |
| 230 | + } |
| 231 | + |
225 | 232 | $stripList = $parser->getStripList(); |
226 | 233 | if ( !in_array( $tagName, $stripList ) ) { |
227 | 234 | return '<span class="error">' . |
— | — | @@ -228,33 +235,23 @@ |
229 | 236 | '</span>'; |
230 | 237 | } |
231 | 238 | |
232 | | - $lastNumberedNode = false; |
233 | 239 | $attributes = array(); |
234 | 240 | foreach ( $args as $arg ) { |
235 | 241 | if ( !$xpath ) { |
236 | 242 | $xpath = new DOMXPath( $arg->ownerDocument ); |
237 | 243 | } |
238 | 244 | $names = $xpath->query( 'name', $arg ); |
239 | | - if ( $names->item( 0 )->hasAttributes() ) { |
240 | | - $lastNumberedNode = $arg; |
241 | | - } else { |
| 245 | + if ( !$names->item( 0 )->hasAttributes() ) { |
242 | 246 | $name = $frame->expand( $names->item( 0 ), PPFrame::STRIP_COMMENTS ); |
243 | | - if ( preg_match( '/^\d+$/', $name ) ) { |
244 | | - // For = suppression syntax {{#tag|thing|1=2=3=4}} |
245 | | - $lastNumberedNode = $arg; |
246 | | - } else { |
247 | | - $values = $xpath->query( 'value', $arg ); |
248 | | - $attributes[$name] = trim( $frame->expand( $values->item( 0 ) ) ); |
| 247 | + $values = $xpath->query( 'value', $arg ); |
| 248 | + $value = trim( $frame->expand( $values->item( 0 ) ) ); |
| 249 | + if ( preg_match( '/^(?:"|\')(.*)(?:"|\')$/s', $value, $m ) ) { |
| 250 | + $value = $m[1]; |
249 | 251 | } |
250 | | - } |
| 252 | + $attributes[$name] = $value; |
| 253 | + } |
251 | 254 | } |
252 | 255 | |
253 | | - if ( !$lastNumberedNode ) { |
254 | | - $inner = null; |
255 | | - } else { |
256 | | - $values = $xpath->query( 'value', $lastNumberedNode ); |
257 | | - $inner = $frame->expand( $values->item( 0 ) ); |
258 | | - } |
259 | 256 | $params = array( |
260 | 257 | 'name' => $tagName, |
261 | 258 | 'inner' => $inner, |