DistributedProofreaders / guiguts

Perl/Tk text editor designed for editing and formatting public domain material for inclusion at Project Gutenberg
GNU General Public License v2.0
9 stars 10 forks source link

Stop misconversion of fractions like 1/100,000 #1268

Closed windymilla closed 1 year ago

windymilla commented 1 year ago

GG is supposed to convert fractions that don't contain commas, to use super/subscript or Unicode characters. E.g. 1/2000 will be converted, but 1/2,000 or 1/100,000 should not be. Previous negative lookahead caught 1/2,000 case, but converted the 1/10 in 1/100,000, since there was another digit before the comma. Fixed by adding optional digits to the negative lookahead.

Fixes #1265

windymilla commented 1 year ago

Testing notes: Fractions that consist solely of digits and a slash (solidus or Unicode fraction slash) should be converted when using Tools, Convert Fractions. However, fractions that contain a comma shouldn't be, e.g. 1/2,000 or 1/100,000 The longer 1/100,000 case wasn't being trapped properly. Converting a variety of fractions (either the unicode or super/subscripts method) should follow the above rule.