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

Links in messages should be highlighted and clickable #2

Closed
znat opened this issue Sep 29, 2018 · 4 comments
Closed

Links in messages should be highlighted and clickable #2

znat opened this issue Sep 29, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@znat
Copy link
Contributor

znat commented Sep 29, 2018

See discussion here: botfront/rasa-addons#15

@znat znat added the enhancement New feature or request label Sep 29, 2018
@amn41
Copy link

amn41 commented Oct 5, 2018

I'm happy to work on this - shall I give it a try?

@znat
Copy link
Contributor Author

znat commented Oct 5, 2018 via email

@amn41
Copy link

amn41 commented Oct 12, 2018

Awesome, I'm having a bit of trouble with npm, but it should really just be this diff:

file:
/src/components/Widget/components/Conversation/components/Messages/components/Message/index.js

 import React, { PureComponent } from 'react';
 import { PROP_TYPES } from 'constants';
+import { linkify } from 'linkify';
 
 import './styles.scss';
 
 class Message extends PureComponent {
   render() {
+    const content = linkify(this.props.message.get('text'));
     return (
       <div className={this.props.message.get('sender')}>
         <div className="message-text" >
-          <p style={{ margin: '0' }}>{this.props.message.get('text')}</p>
+          <p style={{ margin: '0' }}>{content}</p>
         </div>
       </div>
     );
  • adding linkify to the package.json. @znat could you maybe give it a quick try?

@znat
Copy link
Contributor Author

znat commented Oct 12, 2018

@amn41 - It's done and published

@znat znat closed this as completed Oct 12, 2018
digitalWestie pushed a commit to inChat/rasa-webchat that referenced this issue Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants