Last modified: 2013-07-04 10:34:00 UTC
In the PHP parser's implementation of wikitext, <ref name="foo " /> and <ref name=" foo" /> will both merge into <ref name="foo" /> (and <ref name=foo />), but right now Parsoid isn't doing this (they're all detected as distinct). This will cause unexpected behaviour for users in production.
Related URL: https://gerrit.wikimedia.org/r/66012 (Gerrit Change I34009ab6662d05453fe46379c58d6e989f296958)
From a quick look at the PHP code it seems that white-space in tag hook attributes is normalized the same way as regular tag attributes. From Sanitizer::decodeTagAttributes: // Normalize whitespace $value = preg_replace( '/[\t\r\n ]+/', ' ', $value ); $value = trim( $value ); It might make sense to perform the normalization in a more generic way for built-in extension hooks.
I did consider whether I should normalize extension attributes more generally, but reasoned that it doesn't make sense since whitespace semantics would probably be specific to the extension and the specific attribute. So, this generic whitespace normalization in php code is a bit surprising. I guess we'll do the same then.
https://gerrit.wikimedia.org/r/66012 (Gerrit Change I34009ab6662d05453fe46379c58d6e989f296958) | change APPROVED and MERGED [by jenkins-bot]
Related URL: https://gerrit.wikimedia.org/r/66340 (Gerrit Change I7e96fb6d2af444ac2561999de4b01a98a4f29275)
https://gerrit.wikimedia.org/r/66340 (Gerrit Change I7e96fb6d2af444ac2561999de4b01a98a4f29275) | change APPROVED and MERGED [by jenkins-bot]
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]