@@ -137,6 +137,30 @@ function runFixes(is, fixes) {
137
137
const DefaultMode = {
138
138
description : '' ,
139
139
140
+ /*
141
+ * Delegate function for mode-specific word handling. This is mostly used
142
+ * for context-based title changes.
143
+ *
144
+ * @return `false`, such that the normal word handling can take place for
145
+ * the current word. If that should not be done, return `true`.
146
+ */
147
+ doWord ( ) {
148
+ return false ;
149
+ } ,
150
+
151
+ /*
152
+ * Look for and convert vinyl expressions.
153
+ * - Look only at substrings which start with ' ' or '('.
154
+ * - Convert 7', 7'', 7", 7in, and 7inch to '7" ' (followed by space).
155
+ * - Convert 12', 12'', 12", 12in, and 12inch to '12" ' (followed by space).
156
+ * - Do not convert strings like 80's.
157
+ */
158
+ fixVinylSizes ( is ) {
159
+ return is
160
+ . replace ( / ( \s + | \( ) ( 7 | 1 0 | 1 2 ) (?: i n c h \b | i n \b | ' | ' ' | " ) ( [ ^ s ] | $ ) / ig, '$1$2"$3' )
161
+ . replace ( / ( (?: \s + | \( ) (?: 7 | 1 0 | 1 2 ) " ) ( [ ^ ) , \s ] ) / , '$1 $2' ) ;
162
+ } ,
163
+
140
164
isLowerCaseWord ( w ) {
141
165
return LOWER_CASE_WORDS . test ( w ) ;
142
166
} ,
@@ -155,14 +179,6 @@ const DefaultMode = {
155
179
156
180
name : '' ,
157
181
158
- toLowerCase ( str ) {
159
- return str . toLowerCase ( ) ;
160
- } ,
161
-
162
- toUpperCase ( str ) {
163
- return str . toUpperCase ( ) ;
164
- } ,
165
-
166
182
/*
167
183
* Pre-process to find any lowercase_bracket word that needs to be put into
168
184
* parentheses. Starts from the back and collects words that belong into the
@@ -259,28 +275,12 @@ const DefaultMode = {
259
275
return runFixes ( is , POSTPROCESS_FIXLIST ) ;
260
276
} ,
261
277
262
- /*
263
- * Look for and convert vinyl expressions.
264
- * - Look only at substrings which start with ' ' or '('.
265
- * - Convert 7', 7'', 7", 7in, and 7inch to '7" ' (followed by space).
266
- * - Convert 12', 12'', 12", 12in, and 12inch to '12" ' (followed by space).
267
- * - Do not convert strings like 80's.
268
- */
269
- fixVinylSizes ( is ) {
270
- return is
271
- . replace ( / ( \s + | \( ) ( 7 | 1 0 | 1 2 ) (?: i n c h \b | i n \b | ' | ' ' | " ) ( [ ^ s ] | $ ) / ig, '$1$2"$3' )
272
- . replace ( / ( (?: \s + | \( ) (?: 7 | 1 0 | 1 2 ) " ) ( [ ^ ) , \s ] ) / , '$1 $2' ) ;
278
+ toLowerCase ( str ) {
279
+ return str . toLowerCase ( ) ;
273
280
} ,
274
281
275
- /*
276
- * Delegate function for mode-specific word handling. This is mostly used
277
- * for context-based title changes.
278
- *
279
- * @return `false`, such that the normal word handling can take place for
280
- * the current word. If that should not be done, return `true`.
281
- */
282
- doWord ( ) {
283
- return false ;
282
+ toUpperCase ( str ) {
283
+ return str . toUpperCase ( ) ;
284
284
} ,
285
285
} ;
286
286
0 commit comments