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

Drag and Drop keeps HTML #156

Open
markusbucher-she opened this issue Dec 20, 2016 · 14 comments
Open

Drag and Drop keeps HTML #156

markusbucher-she opened this issue Dec 20, 2016 · 14 comments

Comments

@markusbucher-she
Copy link

Hi,
I do not find information how to prevent drag-and-drop of html-content with automatic stripping of all html tags. Copy-paste works fine, but I need the same rules for drag-and-drop.

Thank you for your help
Markus

@bampakoa
Copy link
Contributor

@markusbucher-she could you please be more specific about the issue? Any examples that denote the problem in question? Any plunker?

@markusbucher-she
Copy link
Author

@bampakoa Thank you for your reply.

When copypasting html content from a browser I receive the following result:
grafik

When draganddropping the same content the following result is visible:
grafik

How can I treat draganddrop like copypaste here?

Best
Markus

@bampakoa
Copy link
Contributor

bampakoa commented Jan 9, 2017

You could create a plugin for this case but let's ping @stevermeister to check if this should be a built-in feature 😄

@stevermeister
Copy link
Owner

I think it depends on browser and OS.
When I'm copy-pasting HTML it keeps its markup.
not sure that it should be build-in feature

@bampakoa
Copy link
Contributor

I also believe that the best approach is to create a custom plugin. @markusbucher-she what are your thoughts? I would be happy to help in case you are interested.

@markusbucher-she
Copy link
Author

I would be happy to use such a plugin and appreciate any help @bampakoa
@stevermeister it was a security reason for putting the copypaste-handling in the core? Then I would see this as a security relevant issue as well...

@stevermeister
Copy link
Owner

stevermeister commented Jan 11, 2017

it's not security reason.
we just want to keep editor as light and easy to use as possible

@markusbucher-she
Copy link
Author

@stevermeister Okay, I understand. So I will need a plugin for that. Can you point me to the place, where the copy-paste-Action is in the core so that I can use this in my plugin?
@bampakoa Your Help is still very appreciated :-)

@bampakoa
Copy link
Contributor

@markusbucher-she Do you have any fork of the repository or shall I create one in mine, so that we can collaborate on the feature?

@markusbucher-she
Copy link
Author

@bampakoa I did not create a fork yet. We can use one of yours.

@markusbucher-she
Copy link
Author

@bampakoa How can we proceed? Unfortunately this issue is quite urgent...

@bampakoa
Copy link
Contributor

bampakoa commented Jan 18, 2017

@markusbucher-she You can use the Clear Styles plugin to clear any styles of the text, after drag and drop. You can find information on how to activate it in the README file of the repository. I hope it helps!

@markusbucher-she
Copy link
Author

markusbucher-she commented Jan 18, 2017

For security reasons I must prevent the saving of tags other than <u>``<i> or <b>. I can't let the user press a custom button to remove html or word formatting, this must be done automatically.
Unfortunately the readme doesn't contain the section "plugin creation", so I do not know how to create one...
Right now I try to fork the core to my needs. I managed to add on-drop to several places, but it doesn't seem to fire when dropping. I keep trying :-)

@bampakoa
Copy link
Contributor

@markusbucher-she There is already a section for creating a plugin here

Check this commit in my fork. Maybe you can contribute to this one so that we can later merge it in the official repo of the ngWig editor. You can use it initially for one editor per page like this:

<ng-wig ng-model="text1" buttons="drag-and-drop"></ng-wig>

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

3 participants