TryGhost / migrate

MIT License
39 stars 18 forks source link

[Substack] Author names containing 'and' get split into two authors #1087

Closed dennis-dean closed 3 months ago

dennis-dean commented 3 months ago

In the current version, names containing 'and' (i.e. Brandon or Fernando) get split into two authors ('Br' and 'on' / 'Fern' and 'o').

Confirmed changing this line:

let authorSplit = author.split(/(?:,|and|&)+/).map(function (item) {

to

let authorSplit = author.split(/\s*(?:,\s| and | & )\s*/).map(function (item) {

fixes the issue.

PaulAdamDavis commented 3 months ago

Hey @dennis-dean, great spot, and thank you! Fixed pushed with you as a co-author.