Skip to content

Commit 3dba6c4

Browse files
foolipsideshowbarker
authored andcommitted
Fix Wattsi "topic" emulation for [[StringsLikeThis]]
The space-like characters weren't being suppressed from the beginning and end of the string, like they are with the HadSpace logic in Wattsi.
1 parent 3c0c97c commit 3dba6c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

wattsi2bikeshed.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ function getId(topic) {
6868
// Note: no toLowerCase() because this is already done in getTopic().
6969
return topic
7070
.replaceAll(/["?`]/g, '')
71-
.replaceAll(/[\s<>\[\\\]^{|}%]+/g, '-');
71+
.replaceAll(/[\s<>\[\\\]^{|}%]+/g, ' ').trim()
72+
.replaceAll(' ', '-');
7273
}
7374

7475
// Get the linking text like Bikeshed:

0 commit comments

Comments
 (0)