Last modified: 2010-05-15 15:37:34 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 T3937, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1937 - ISBN links are rendered incorrecly in 1.5-cvs
ISBN links are rendered incorrecly in 1.5-cvs
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.5.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: parser, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-20 23:09 UTC by Ævar Arnfjörð Bjarmason
Modified: 2010-05-15 15:37 UTC (History)
0 users

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


Attachments
patch for HEAD (930 bytes, patch)
2005-05-02 06:17 UTC, Michael Keppler
Details

Description Ævar Arnfjörð Bjarmason 2005-04-20 23:09:11 UTC
the "-" in ISBN links is transformed to – in 1.5-cvs, this has to do with
the second regular expression in the $dashReplace array in includes/Parser.php
Comment 1 Ævar Arnfjörð Bjarmason 2005-04-30 02:57:22 UTC
De-assigned myself.
Comment 2 Michael Keppler 2005-05-02 06:17:09 UTC
Created attachment 488 [details]
patch for HEAD

The main idea of this patch is to check if there are additional dashes or
digit-dash combinations around the combination of digit,dash,digit (which is
currently searched and replaced).
Therefore the look behind and look ahead assertions have been changed a bit:
The look ahead is now
(?=\d+[^-\d])
to check that no other dashes come after some digits.
The look behind assertion needs to be the same in reverse order, at least
theoretically. But look behinds need to have a fixed length, therefore the look
behind has been changed to
(?<=\d)(?<!-\d|-\d{2}|-\d{3}|-\d{4}|-\d{5}|-\d{6})
That checks that there is no additional dash up to 6 digits before the current
dash. The negative assertion part could (in theory) be written as "-\d{1,6}"
but that doesn't compile because of the fixed length requirement.
I have choosen 6 as the maximum number of digits to check in the look behind
assertion, because a 10 digit ISBN should never have more than 6 consecutive
digits (written with dashes), if I understand the details of that standard
right.
Comment 3 Michael Keppler 2005-05-02 18:49:31 UTC
After some discussion with other developers it seems that my patch is not
necessary. The problem might be solved better by changing the order of
processing steps in the parser, so that the dash conversion occurs later.
See bug 2021 for a similar problem.
Comment 4 JeLuF 2005-05-03 04:51:43 UTC
Fixed in CVS HEAD, Parser.php rev 1.431

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


Navigation
Links