Last modified: 2010-05-15 15:37:34 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
De-assigned myself.
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.
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.
Fixed in CVS HEAD, Parser.php rev 1.431