Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1982
patch_1937_parser_cvs.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 8:21 PM
2014-11-21 20:21:51 (UTC+0)
Size
930 B
Referenced Files
None
Subscribers
None
patch_1937_parser_cvs.txt
View Options
Index: Parser.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Parser.php,v
retrieving revision 1.430
diff -u -r1.430 Parser.php
--- Parser.php 1 May 2005 01:11:15 -0000 1.430
+++ Parser.php 1 May 2005 09:43:26 -0000
@@ -186,7 +186,9 @@
$dashReplace = array(
'/ - /' => " – ", # N dash
- '/(?<=[0-9])-(?=[0-9])/' => "–", # N dash between numbers
+ '/(?<=\d)(?<!-\d|-\d{2}|-\d{3}|-\d{4}|-\d{5}|-\d{6})-(?=\d+[^-\d])/' => "–", # N dash between numbers
+ // the lookbehind assertions avoid wrong replacements in ISBN numbers (checking for up to 6 consecutive numbers between dashes)
+ // they can't be written as shorter combination as lookbehinds must have fixed length
'/ -- /' => " — " # M dash
);
$text = preg_replace( array_keys($dashReplace), array_values($dashReplace), $text );
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1485
Default Alt Text
patch_1937_parser_cvs.txt (930 B)
Attached To
Mode
T3937: ISBN links are rendered incorrecly in 1.5-cvs
Attached
Detach File
Event Timeline
Log In to Comment