@marguerite You should also remove mentions.js.es6 from the plugin. There’s no need to patch anything related to usernames anymore. Only your customizations for categories and tags might still be needed, but we will fix that as well.
The +? at the end of the regex isn’t needed.
Out of curiosity: Can this whitelist be used for both zh_CN and zh_TW or is there a difference?
I’m happy to see support for Unicode usernames and group names .
With the introduction of the support for Unicode usernames however, there’s now a bit of a odd situation where Discourse can support something like 中国 or ไทย as a username, but not -dashing- as it still requires the first and last character to be a letter, number or underscore (but not a dash).
I tried using the Unicode support setting to add support for the dash character but that didn’t seem to work for me, although I may have missed something.
Would it make sense to revise this rule for the first/last characters about the dash now that Unicode is supported? Is there a reason to continue not allowing dash on the first&last position but allow any non-ASCII letter (including the underscore)? Dash doesn’t seem to require special encoding on URLs, but maybe there’s another reason for this?
I know this is a bit of a tangent to the topic, so let me know if I should open a separate one.