Skip to content

Commit 3c01e65

Browse files
authored
Merge pull request #67 from mrbot-ai/fix-named-links-markdown
Fix named links markdown
2 parents bc9085f + 24f7a99 commit 3c01e65

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.5.6
2+
- fixed a bug where named links would not render in a received message
3+
14
## 0.5.5
25
- new prop, `docViewer`, if this props is true, this will treat every link in received messages as a document and will open it in a popup using docs.google.com/viewer (note: this is an experimental feature and should be used with caution)
36

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A simple webchat widget to connect with a chatbot. Forked from [react-chat-widge
2020
In your `<body/>`:
2121
```javascript
2222
<div id="webchat"/>
23-
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.5.js"></script>
23+
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.6.js"></script>
2424
<script>
2525
WebChat.default.init({
2626
selector: "#webchat",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rasa-webchat",
3-
"version": "0.5.5",
3+
"version": "0.5.6",
44
"description": "Chat web widget for React apps and Rasa Core chatbots",
55
"main": "lib/index.js",
66
"repository": "git@https://github.com/mrbot-ai/rasa-webchat.git",

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class Message extends PureComponent {
2626
transformLinkUri={null}
2727
renderers={{
2828
link: props =>
29-
docViewer ? <DocViewer src={props.href} /> : <a href={props.href}>{props.href}</a>
29+
docViewer ? (
30+
<DocViewer src={props.href}>{props.children}</DocViewer>
31+
) : (
32+
<a href={props.href}>{props.children}</a>
33+
)
3034
}}
3135
/>
3236
) : (

src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DocViewer extends Component {
5050
return (
5151
<span>
5252
<button onClick={this.handleOpenModal} className="doc-viewer-open-modal-link">
53-
{this.props.src}
53+
{this.props.children}
5454
</button>
5555
{this.state.openedModal && (
5656
<Portal>

0 commit comments

Comments
 (0)