Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When .insert() with BBCode into WYSIWYG, surrounding space is removed #452

Closed
brunoais opened this issue Jun 21, 2015 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@brunoais
Copy link
Collaborator

If you try to select some text and include spaces in the selection, then you programatically call .insert() using BBCode (using just the first 2 parameters), the surrounding space around the selection is trimmed out.
E.g:
Assume you have a tag called s which is correctly set to form <s> tags.
If you type:

abc def ghi

if you select (including the space)

def 

Then you call the editor's .insert() like this:

editor.insert('[s]', '[/s]');

you get:

abc <s>def</s>ghi

Instead of:

abc <s>def</s> ghi

This seems to be caused by https://github.com/samclarke/SCEditor/blob/master/src/plugins/bbcode.js#L1871.

I'm not doing anything because I don't really know the reason why that method call is there.

@samclarke samclarke added this to the v2.0.0 milestone Dec 6, 2016
@samclarke samclarke self-assigned this Dec 6, 2016
@samclarke samclarke modified the milestones: v2.0.0, v2.1.0 Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants