Last modified: 2013-07-04 10:34:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50941, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48941 - Reference names should have whitespace stripped for the purposes of merging them
Reference names should have whitespace stripped for the purposes of merging them
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal minor
: ---
Assigned To: ssastry
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-29 14:51 UTC by James Forrester
Modified: 2013-07-04 10:34 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description James Forrester 2013-05-29 14:51:37 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.
Comment 1 Gerrit Notification Bot 2013-05-29 16:55:10 UTC
Related URL: https://gerrit.wikimedia.org/r/66012 (Gerrit Change I34009ab6662d05453fe46379c58d6e989f296958)
Comment 2 Gabriel Wicke 2013-05-30 07:45:11 UTC
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.
Comment 3 ssastry 2013-05-30 12:08:57 UTC
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.
Comment 4 Gerrit Notification Bot 2013-06-01 13:39:05 UTC
https://gerrit.wikimedia.org/r/66012 (Gerrit Change I34009ab6662d05453fe46379c58d6e989f296958) | change APPROVED and MERGED [by jenkins-bot]
Comment 5 Gerrit Notification Bot 2013-06-01 16:34:00 UTC
Related URL: https://gerrit.wikimedia.org/r/66340 (Gerrit Change I7e96fb6d2af444ac2561999de4b01a98a4f29275)
Comment 6 Gerrit Notification Bot 2013-06-01 20:02:11 UTC
https://gerrit.wikimedia.org/r/66340 (Gerrit Change I7e96fb6d2af444ac2561999de4b01a98a4f29275) | change APPROVED and MERGED [by jenkins-bot]
Comment 7 Andre Klapper 2013-07-04 10:34:00 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links