Skip to content

Commit 9ec1b4b

Browse files
brandonrobertsgr2m
authored andcommitted
fix: support for usernames with multiple dashes
1 parent bcf93a9 commit 9ec1b4b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/parse-comment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ nlp.plugin(plugin);
133133

134134
function findWho(message, action) {
135135
function findWhoSafe(match) {
136-
message = message.replace("-", "#/#"); // workaround (https://github.com/spencermountain/compromise/issues/726)
136+
message = message.replace(/\-/g, "#/#"); // workaround (https://github.com/spencermountain/compromise/issues/726)
137137
const whoNormalizeSettings = {
138138
whitespace: true, // remove hyphens, newlines, and force one space between words
139139
case: false, // keep only first-word, and 'entity' titlecasing
@@ -155,7 +155,7 @@ function findWho(message, action) {
155155

156156
if (matchedSet.length > 0) {
157157
matchedText = matchedSet[0].text;
158-
matchedText = matchedText.replace("#/#", "-");
158+
matchedText = matchedText.replace(/#\/#/g, "-");
159159

160160
return matchedText;
161161
}

0 commit comments

Comments
 (0)