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

Strip html on paste #86

Closed
valentinvieriu opened this issue Jan 29, 2014 · 6 comments
Closed

Strip html on paste #86

valentinvieriu opened this issue Jan 29, 2014 · 6 comments
Milestone

Comments

@valentinvieriu
Copy link

Right now when I paste content from a different website it does not strip the html from that content. Is there a way to implement strip html on paste?

@SimeonC
Copy link
Collaborator

SimeonC commented Jan 30, 2014

Currently no. You could catch the paste event and insert your own html removal code, or there's always the clear formatting button currently in the toolbar (the 'ban' symbol, or circle with a line through). Possibly this could be added as on option later.

@michaelpelletier
Copy link

I had a similar issue this morning. I managed a workaround in for now, but definitely look forward to having this as an option.

@SimeonC
Copy link
Collaborator

SimeonC commented Mar 3, 2014

Hi, could I get some more information on what you wanted stripped out. Some specific examples would be useful as then I can create tests that cover actual use cases rather than something I made up that should work!

As I see it there are 2 ways of implementing this, depending on requirements. The first is to use the sanitizer that runs on every update on the pasted in code, the other is to do something like strip all tags out and only insert in a text string.

@SimeonC SimeonC added this to the 1.2.1 milestone Mar 3, 2014
@worldspawn
Copy link
Contributor

Again, for stripping out all html and leaving only text, the innerText value delivers a lot for free.

@FilipMatys
Copy link

Would appreciate a temporary solution. Right now got stucked on it and haven't found one, yet :/

My need for this feature would be:
To strip all html tags only from pasted data, not the ones already in. You could say the same functionality as Imperavi Redactor has. Thank You for Your great work by the way! Best wysiwyg there is

@SimeonC
Copy link
Collaborator

SimeonC commented Mar 28, 2014

Most recent commit to the Repo does this, I've only included it on the contenteditable div, ie wysiwyg mode. Thanks to @worldspawn for the innerText tip.

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

No branches or pull requests

5 participants