Last modified: 2012-04-16 09:15:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 27473 - Apostrophe in linktrail breaks bolded links
Apostrophe in linktrail breaks bolded links
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: High enhancement (vote)
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks: 26676
  Show dependency treegraph
 
Reported: 2011-02-16 20:38 UTC by Roan Kattouw
Modified: 2012-04-16 09:15 UTC (History)
5 users (show)

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


Attachments
Proposed fix: Check for double apostrophe in Linker::splitTrail() (748 bytes, patch)
2011-03-26 16:10 UTC, P.Copp
Details
Alternative fix: Modify Ca and Kaa linktrail (888 bytes, patch)
2011-03-27 17:06 UTC, Platonides
Details

Description Roan Kattouw 2011-02-16 20:38:02 UTC
ca and kaa had an apostrophe (') in their linktrail. In 1.16 this worked fine, in 1.17 this caused things like '''[[Foo]]''' to be interpreted as '''[[Foo|Foo''']], which renders the apostrophes as literal characters in the link text and bolds the rest of the line. In other words, link trail processing seems to be done before triple apostrophe processing rather than after.
Comment 1 Tim Starling 2011-02-17 06:17:40 UTC
The parse order has changed for good reason. The simple way to fix this is to make the link trail regex not match two apostrophes in a row, with something like:

/ [a-z]* ( ' [a-z]* )? /

The complex way to fix it is to implement the same logic in Linker::splitTrail(), so that it works regardless of what the link trail regex is set to.
Comment 2 P.Copp 2011-03-26 16:10:24 UTC
Created attachment 8332 [details]
Proposed fix: Check for double apostrophe in Linker::splitTrail()

Unless I'm missing something, the fix is fairly simple. Search for '' in the link trail and put it outside of the link, if found. Only adds one strpos call per link, so it shouldn't add much processing time, either.

Parser tests still missing, though. I wasn't sure if we can make them dependent on a certain linktail regex.
Comment 3 Platonides 2011-03-27 17:06:07 UTC
Created attachment 8337 [details]
Alternative fix: Modify Ca and Kaa linktrail

Patch for changing the linktrail in the messages file. The linktrail is not NS_MEDIAWIKI customizable, so we have full control to make them match the current code.

I am using a negative lookahead instead of duplicating the rest of the linktrail.
Comment 4 Brion Vibber 2011-04-06 21:14:01 UTC
I've committed the fix for the ca & kaa linktrails as r85573, including parser test cases and a fix to Linker::splitTrail() for a bug that caused it to fail to actually test linktrails properly when $wgContLang changes over the course of a run.
Comment 5 Brion Vibber 2011-04-06 21:18:29 UTC
For the moment I think I prefer the alt linktrails to the explicit check in splitTrail. Longer term we should consider a genericization of linktrails so we don't need the language-specific checks though, and should then consider apostrophes more generally if they're needed.

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


Navigation
Links