Skip to content

Commit

Permalink
Merge pull request #67 from mrbot-ai/fix-named-links-markdown
Browse files Browse the repository at this point in the history
Fix named links markdown
  • Loading branch information
MatthieuJnon authored Mar 6, 2019
2 parents bc9085f + 24f7a99 commit 3c01e65
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.5.6
- fixed a bug where named links would not render in a received message

## 0.5.5
- 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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A simple webchat widget to connect with a chatbot. Forked from [react-chat-widge
In your `<body/>`:
```javascript
<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.5.js"></script>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.6.js"></script>
<script>
WebChat.default.init({
selector: "#webchat",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rasa-webchat",
"version": "0.5.5",
"version": "0.5.6",
"description": "Chat web widget for React apps and Rasa Core chatbots",
"main": "lib/index.js",
"repository": "git@https://github.com/mrbot-ai/rasa-webchat.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class Message extends PureComponent {
transformLinkUri={null}
renderers={{
link: props =>
docViewer ? <DocViewer src={props.href} /> : <a href={props.href}>{props.href}</a>
docViewer ? (
<DocViewer src={props.href}>{props.children}</DocViewer>
) : (
<a href={props.href}>{props.children}</a>
)
}}
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DocViewer extends Component {
return (
<span>
<button onClick={this.handleOpenModal} className="doc-viewer-open-modal-link">
{this.props.src}
{this.props.children}
</button>
{this.state.openedModal && (
<Portal>
Expand Down

0 comments on commit 3c01e65

Please sign in to comment.