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

How to capture paste event and modify HTML attributes #6114

Open
raxhacks opened this issue Jan 21, 2024 · 2 comments
Open

How to capture paste event and modify HTML attributes #6114

raxhacks opened this issue Jan 21, 2024 · 2 comments

Comments

@raxhacks
Copy link

raxhacks commented Jan 21, 2024

I want to know if it is possible to somehow listen for the pasting event and modify the span tag attributes. For example I want it to be possible that when I paste some text it could be in this format:
<span data-src="test">PASTED TEXT</span>

I want it to include the data-src. Has this been possible?

@SamTV12345
Copy link
Member

You can find the possibility to listen for paste events here: https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event

@raxhacks
Copy link
Author

You can find the possibility to listen for paste events here: https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event

Hi, thank you for the response. I already tried using the event, my question is more what function inside Etherpad's source code I can call in order to add custom atributes to the pasted tag.

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

2 participants