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

Cannot able to get the selected text along with its formatted html #221

Open
suganyapalani22 opened this issue Sep 21, 2020 · 0 comments
Open

Comments

@suganyapalani22
Copy link

When selecting the text, i need to add the outer div with some format, I have used this code, but throws some exceptions,

const range = currentElement.summernote('createRange');
var newrange=range.nativeRange()
const newParent = document.createElement('span');
newParent.setAttribute('contenteditable', false);
newParent.setAttribute('class', 'freeze-word');
var newtext=newrange.surroundContents(newParent);

The exception,
Failed to execute 'surroundContents' on 'Range': The Range has partially selected a non-Text node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant