diff --git a/wattsi2bikeshed.js b/wattsi2bikeshed.js index 20f387b..d7b0bcc 100644 --- a/wattsi2bikeshed.js +++ b/wattsi2bikeshed.js @@ -68,7 +68,8 @@ function getId(topic) { // Note: no toLowerCase() because this is already done in getTopic(). return topic .replaceAll(/["?`]/g, '') - .replaceAll(/[\s<>\[\\\]^{|}%]+/g, '-'); + .replaceAll(/[\s<>\[\\\]^{|}%]+/g, ' ').trim() + .replaceAll(' ', '-'); } // Get the linking text like Bikeshed: