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

Added the ability to insert HTML into a "contenteditable" field #217

Merged
merged 1 commit into from
Mar 9, 2016
Merged

Added the ability to insert HTML into a "contenteditable" field #217

merged 1 commit into from
Mar 9, 2016

Conversation

maxdev1
Copy link
Contributor

@maxdev1 maxdev1 commented Nov 23, 2015

These changes allow the "replace" function of the strategy to return
HTML for both the pre and the post parts. The HTML is then inserted
correctly and the cursor positioned in between them. With this, it is
for example possible to directly insert smiley etc.. This should
also resolve issue #105.

You could extend the Demo with the help of this feature, might convince
even more people to use it! :-)

These changes allow the "replace" function of the strategy to return
HTML for both the pre and the post parts. The HTML is then inserted
correctly and the cursor positioned in between them. With this, it is
for example possible to directly insert smiley <img> etc.. This should
also resolve issue #105.
@jbrunhuber
Copy link

Nice enhancement 👍

yuku added a commit that referenced this pull request Mar 9, 2016
Added the ability to insert HTML into a "contenteditable" field
@yuku yuku merged commit b0f08e1 into yuku:master Mar 9, 2016
@yuku
Copy link
Owner

yuku commented Mar 9, 2016

Hi @maxdev1, thanks for the patch and sorry for my late reply!
Since I'm no longer using this plugin against contenteditable, I have not read this pull request seriously. But,,, maybe it's worth being merged. thanks

@metamatt
Copy link
Contributor

This change breaks the case that the "replace" function returned an empty string, which is something that I was doing to insert HTML in place of the string that was entered. (range.setStartAfter(lastOfPre); gets called with lastOfPre set to undefined). Perhaps I don't need to do that any more, though.

@yuku yuku added the DEPRECATED jquery-textcomplete Issues associated to jquery-textcomplete (was DEPRECATED) label Jun 15, 2020
@ShaMan123
Copy link

This fix seemed to have been lost

@ShaMan123 ShaMan123 mentioned this pull request May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEPRECATED jquery-textcomplete Issues associated to jquery-textcomplete (was DEPRECATED)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants