Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

When to add spaces after an inserted mention? #713

Open
artcodespace opened this issue Jun 9, 2023 · 0 comments
Open

When to add spaces after an inserted mention? #713

artcodespace opened this issue Jun 9, 2023 · 0 comments

Comments

@artcodespace
Copy link
Contributor

The current implementation of mentions as nodes adds a space only when there is no next sibling. This could be improved, for example if you have a mention directly next to am inline formatting node containing text, so you could end up with <mention /><strong>text</strong> and no space between the mention and the text.

Perhaps a better approach would start from:

Perhaps it's easier to define when we don't add a space. To me it seems that we shouldn't add a space if there is a leaf following the mention we've just added and that leaf doesn't already starts with a space. In all other cases add a space.

Testing for all the permutations of using a mention before other nodes would help smooth out the desired behaviour in all cases.

@jonnyandrew jonnyandrew added A-Mentions T-Enhancement Improvement or feature request labels Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants