@@ -228,7 +228,8 @@ public enum PageId {
228
228
Measurement_Systems (SectionId .Units , "Measurement Systems" ),
229
229
Duration (SectionId .Units ),
230
230
Graphics (SectionId .Units ),
231
- Length (SectionId .Units ),
231
+ Length_Metric (SectionId .Units , "Length Metric" ),
232
+ Length_Other (SectionId .Units , "Length Other" ),
232
233
Area (SectionId .Units ),
233
234
Volume_Metric (SectionId .Units , "Volume Metric" ),
234
235
Volume_US (SectionId .Units , "Volume US" ),
@@ -2221,12 +2222,7 @@ private static String fix(String input, int orderIn) {
2221
2222
while (true ) {
2222
2223
int functionStart = input .indexOf ('&' , pos );
2223
2224
if (functionStart < 0 ) {
2224
- if ("Volume" .equals (input )) {
2225
- return getVolumePageId (args .value [0 ] /* path */ ).toString ();
2226
- } else if ("Other Units" .equals (input )) {
2227
- return getOtherUnitsPageId (args .value [0 ] /* path */ ).toString ();
2228
- }
2229
- return input ;
2225
+ return adjustPageForPath (input , args .value [0 ] /* path */ ).toString ();
2230
2226
}
2231
2227
int functionEnd = input .indexOf ('(' , functionStart );
2232
2228
int argEnd =
@@ -2246,12 +2242,35 @@ private static String fix(String input, int orderIn) {
2246
2242
}
2247
2243
}
2248
2244
2245
+ private static String adjustPageForPath (String input , String path ) {
2246
+ if ("Length" .equals (input )) {
2247
+ return getLengthPageId (path ).toString ();
2248
+ }
2249
+ if ("Other Units" .equals (input )) {
2250
+ return getOtherUnitsPageId (path ).toString ();
2251
+ }
2252
+ if ("Volume" .equals (input )) {
2253
+ return getVolumePageId (path ).toString ();
2254
+ }
2255
+ return input ;
2256
+ }
2257
+
2249
2258
private static Set <UnitConverter .UnitSystem > METRIC_UNITS =
2250
2259
Set .of (UnitConverter .UnitSystem .metric , UnitConverter .UnitSystem .metric_adjacent );
2251
2260
2252
2261
private static Set <UnitConverter .UnitSystem > US_UNITS =
2253
2262
Set .of (UnitConverter .UnitSystem .ussystem );
2254
2263
2264
+ private static PageId getLengthPageId (String path ) {
2265
+ final String shortUnitId = getShortUnitId (path );
2266
+ if (isSystemUnit (shortUnitId , METRIC_UNITS )) {
2267
+ return PageId .Length_Metric ;
2268
+ } else {
2269
+ // Could further subdivide into US/Other with isSystemUnit(shortUnitId, US_UNITS)
2270
+ return PageId .Length_Other ;
2271
+ }
2272
+ }
2273
+
2255
2274
private static PageId getVolumePageId (String path ) {
2256
2275
final String shortUnitId = getShortUnitId (path );
2257
2276
if (isSystemUnit (shortUnitId , METRIC_UNITS )) {
0 commit comments