用户名中删除了特殊字符

On our main site there are often people who use underscores and dashes in usernames. When they are ported to our Discourse forum, one or more of those characters is often dropped from the username, resulting in a mismatch.

The forum is provided for the site users only and being able to correlate between the usernames is important.

Examples:
kayakaya_ becomes kayakaya
__aena13 becomes _aena13

At present we haven’t figured out how to either automatically delete or disable forum accounts when the mains are closed or at least generate a report. Is that possible?

The usernames are being auto-edited to reflect the Discourse rules for usernames.

That’s pretty much what I figured. Thankfully we have found a place that keeps the actual username intact.

We recently added two site settings which allow you to permit more characters in the username

Did you try tweaking those?

We’ll take a look at that and see if it helps. Thank you.

我们在 SSO 方面也遇到了同样的问题,用户名被转换了。

我之前在 这里 提到过这个问题,但这个话题更新一些——也许有人可以查看一下。

随着对用户名和组名引入 Unicode 支持,现在可以使用像 中国 这样的用户名(这很棒!),但 Discourse 不允许用户名以连字符开头或结尾(但下划线等符号是可以的)。

禁止在首尾位置使用连字符有什么原因吗?如果这样做没有明显的弊端,是否有机会修订这一政策?/cc @Falco

当用户输入特殊字符时,情况会变得复杂,因为他们想要的用户名已被占用。

您可以尝试在自定义插件中覆盖这些规则,并先使用几周。如果在正常的 Discourse 使用中未出现问题,请提交拉取请求。

我试着做了尝试,成功实现了用户名前后带连字符的功能,包括在提及(mentions)中也能正常工作。

但在用户名前后带下划线的情况下就没那么幸运了。因为在消息编辑器中,Markdown 解析器的优先级似乎高于 @提及:用户名被渲染成了斜体,而不是链接。

目前我在这方面有些卡住,不确定该从哪里入手解决。有什么建议吗?@Falco