Fix #1198: Unwanted trailing space is added
fixes https://github.com/jpuri/react-draft-wysiwyg/issues/1198
@jpuri can we have a system for changelog/ versioning. It will be easy to add features then.
Commenting for visibility, as I'm having the same issue as @0xrushi.
Use case:
We use react-draft-wysiwyg to edit content that will later be shown in the app.
The person that creates the content has it already prepared somewhere else (content has to be approved beforehand), copy/pastes it into the editor and then adds the missing links.
For every link that is added, an unneeded extra-space is also added so it has to be manually removed.
Bonus points:
This PR fixes a second issue:
Check that the selection range used to insert the space is calculated as selection.get('anchorOffset') + linkTitle.length.
If the selection was done backwards, this will insert the space linkTitle.length characters after the link.
Here's a demo of this:
same here, would be great if you could merge this PR