Last modified: 2014-06-30 01:03:46 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 T69225, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67225 - Hovercards: Space before removed parentheses should also be removed in the extract
Hovercards: Space before removed parentheses should also be removed in the ex...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Popups (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-28 00:13 UTC by Laurence 'GreenReaper' Parry
Modified: 2014-06-30 01:03 UTC (History)
3 users (show)

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


Attachments

Description Laurence 'GreenReaper' Parry 2014-06-28 00:13:05 UTC
This commit removed parentheses from extracts:
https://gerrit.wikimedia.org/r/#/c/132663/

However, the space before the parentheses is not removed, which results in an incorrect space, often directly before punctuation.

Example: http://en.wikifur.com/wiki/Category:NordicFuzzCon_staff

For the article "Vappu", which starts:
"Vappu (born August 7), also known as Lexy, Alexis and Alexistar..."
The extract is:
"Vappu , also known as Lexy, Alexis and Alexistar..."
There should not be a space after "Vappu". I think you could do something like "(\s?)" before the rest of the regex to remove this.
Comment 1 Prateek Saxena 2014-06-30 00:14:03 UTC
The following commit addressed this issue - https://gerrit.wikimedia.org/r/#/c/135759/ 

Have you upgraded and still facing this problem?
Comment 2 Laurence 'GreenReaper' Parry 2014-06-30 00:25:09 UTC
Yes, we are running on the current HEAD.

That commit removed parentheses and the material within them. It left the space immediately before the parentheses when the parentheses was followed by punctuation, such as a comma or full stop. (This was not handled by the regexp that was replaced, either.)

The line:
extract = extract.replace(/\s+/g, ' '); // Remove extra white spaces 
will only replace two or more spaces with one. It does not remove the single space between "Vappu" and "," in the example above.
Comment 3 Prateek Saxena 2014-06-30 00:30:02 UTC
Understood. I'll add failing test cases for the example you mentioned and look into this. Thank you!
Comment 4 Laurence 'GreenReaper' Parry 2014-06-30 00:37:37 UTC
Cool! If you do make changes, it might also be worth revisiting the name of the function and the accompanying comment, since what is being removed is not what I'd call brackets - [] or {} - but parentheses - () - and also their content.

I know (...now, per https://en.wikipedia.org/wiki/Bracket ) that parentheses are technically a type of bracket, but in that case I would expect other brackets to be affected as well. Perhaps something like removeParenthesizedContent()?

(Another possibility is that other types of brackets should be removed, but that'd be an entirely separate bug.)
Comment 5 Prateek Saxena 2014-06-30 00:52:50 UTC
> I know (...now, per https://en.wikipedia.org/wiki/Bracket ) that parentheses are technically a type of bracket, but in that case I would expect other brackets to be affected as well. Perhaps something like removeParenthesizedContent()?

This patch corrected the name of the function and some variable names too.
Comment 6 Prateek Saxena 2014-06-30 01:03:46 UTC
> This patch corrected the name of the function and some variable names too.

Sorry! Forgot to add the link - https://gerrit.wikimedia.org/r/#/c/141661/

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


Navigation
Links