>>123 修正

コレだとバグります
.replace(/[  ]+/ig,

コレで直りました
.replace(/[  ]+/g,