Single space is lost between two mentions

Created on 28 July 2019, almost 5 years ago
Updated 3 July 2023, 12 months ago

Problem/Motivation

Assume that there are accounts foo_user and bar_user on the system.

Using a text field for which the Mentions module is enabled, enter "@foo_user @bar_user", with a single space between the two mentions. Save.

I find that the space is removed, leading to something like this (depending on the user IDs):

<a href="/user/11" class="mentions mentions-11">foo_user</a><a href="/user/16" class="mentions mentions-16">bar_user</a>

I have tested this using the Editor module. I checked the database, and the text field was saved as @foo_user @bar_user (with a single space) so I do not think we can blame this on the Editor module.

I am calling this a Minor bug because

  1. I think it is pretty unusual to want two mentions with only a single space between them.
  2. There are workarounds. For example, two spaces are converted (by the Editor module, I believe) into &nbsp; (a non-breaking space followed by a space), and that is preserved.

Proposed resolution

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇺🇸United States benjifisher Boston area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024