Merge pull request #26 from j-selby/master
Filter out articles in titles when sorting
This commit is contained in:
commit
5c04f40997
|
@ -124,7 +124,16 @@ function processGame(game) {
|
|||
model.testcase_date = recent.date;
|
||||
}
|
||||
|
||||
let section_id = `${model.title[0]}`.toLowerCase();
|
||||
const toTrim = ["the", "a", "an"];
|
||||
|
||||
let trimmedTitle = model.title.toLowerCase();
|
||||
toTrim.forEach(trim => {
|
||||
if (trimmedTitle.startsWith(trim)) {
|
||||
trimmedTitle = trimmedTitle.substr(trim.length + 1);
|
||||
}
|
||||
});
|
||||
|
||||
let section_id = `${trimmedTitle[0]}`;
|
||||
if (!section_id.match(/[a-z]+/)) {
|
||||
section_id = "#";
|
||||
}
|
||||
|
|
Reference in New Issue