Git Product home page Git Product logo

Comments (6)

supersnager avatar supersnager commented on July 29, 2024

@Rushsoul What exactly do you mean by "send them as it is"?
Do you want to get DOMTree from contentediable div as a onSend callback param? If so, what do you want to achieve by this?

from chat-ui-kit-react.

no-1ne avatar no-1ne commented on July 29, 2024

May be they want to copy image and paste it

from chat-ui-kit-react.

supersnager avatar supersnager commented on July 29, 2024

@startupgurukul I'dont know. I'm waiting for a reply from @Rushsoul :)

from chat-ui-kit-react.

KariBhanu avatar KariBhanu commented on July 29, 2024

i am sorry that i haven't replied, i came out from the organization so , i don't know weather it is solved or not there.

from chat-ui-kit-react.

KariBhanu avatar KariBhanu commented on July 29, 2024

@startupgurukul I'dont know. I'm waiting for a reply from @Rushsoul :)

i will tell u the problem, lets se in all other message applications when we paste some link and send in chat, it will be sent as link only , i mean receiver no need to copy that link, by just clicking on it, it will open that link in chrome.

from chat-ui-kit-react.

supersnager avatar supersnager commented on July 29, 2024

@Rushsoul Ok, I understand now what you want to achieve.
But now in onSend callback you are getting innerHTML of message input.
So if user copy a link from notepad, or from website by choosing "copy link address" from right-click context menu, this link is copied to buffer as clear text.
When user paste this link to message input, this is also pasted as clear text without html "A" tag and you will get it in callback also as clear text.

In other case when user mark some linked text on website and do CTRL+C on keyboard this is copied as HTML to buffer.
When user paste this link to message input, this is pasted as html code with A tag and you will get it in callback as html.

I think, you are talking about first case. But it's up to you to process message received as a clear text, find link in it and wrap this link in html A tag.
This library is UI library and has nothing to do with text processing.

Moreover you should always sanitize all pasted content, because it's potentialy dangerous (it can contains dangerous scripts, or it just might ruin your layout).
Please never send direct html without sanitization to other user.

And one more important thing:
When you send copied html link directly without any processing, you don't know what you send. So if this link have target="_self" when your remote user click on this link it will be opened in the same browser window, so your chat application will gone. This is probably not expected behaviour :)

That's why you should always keep an eye on what you send and display.

from chat-ui-kit-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.