Page MenuHomePhabricator

Genfixes add space for kW but not MW
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Load [[Hyosung]] with genfixes

What happens?:

  • AWB changes "750kW" to "750 kW" but does not change "2MW"

What should have happened instead?:

  • Also add a space for MW per [[MOS:UNITSYMBOLS]]

Software version
AWB 6.4.0.1 SVN 12948

Event Timeline

public static readonly Regex UnitsWithoutNonBreakingSpaces = new Regex(@"(\b\d?\.?\d+)[\s\u00a0]*([cmknuµ][mgWN]|m?mol|cd|mi|lb[fs]?|b?hp|mph|ft|dB|[kGM]?Hz|m/s|°[CF])\b(?<!(\d?\.?\d+)mm)");

I'm guessing this is because this isn't case insensitive, but whether we want to make it that way...

rev 12692 adds a test case for this.. commented out because it doesn't pass (obviously)

@GoingBatty Before making the change we'd need to check for any false positives (any other users where a number followed MW doesn't mean megawatt). Would you be able to run a database scan and check? For simplicity a regex search for \d\s*MW\b should do the job.