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

Send response in raw HTML #58

Closed
smrb opened this issue Jan 16, 2019 · 7 comments
Closed

Send response in raw HTML #58

smrb opened this issue Jan 16, 2019 · 7 comments
Assignees

Comments

@smrb
Copy link

smrb commented Jan 16, 2019

Hello!

Is there a way to send a Message as raw HTML?

I've got a custom action that's getting called, generating a Message containing some links retrieved from a database, which then are saved into a slot, which content is than echoed in the the Bots response.

At the Moment, the HTML seems to get escaped, so I'm getting

<a href="http://127.0.0.1/test/****>****Title, where the URL is a clickable Link instead of
just showing ****Title as a clickable Link.

Is there a way of changing this behavior? Is this even a problem with the chat script or is this an issue with Rasa?

@znat
Copy link
Contributor

znat commented Jan 16, 2019

@tomgrassmann you can use markdown [click here](http://link.to)

@znat znat closed this as completed Jan 16, 2019
@netcarver
Copy link

netcarver commented Mar 5, 2019

@znat Hello Nathan. I think I'm hitting this issue as well.

If I output a link in markdown format, the [title part] seems to be totally ignored and the url string is appearing as both the title text and the href of the generated anchor.

Here's an example. I added a fake accounting topic entry to my FAQ document that has a markdown link in it...

screeny-0066

... and here's how it's rendered by rasa-webchat...
screeny-0065

The same link renders correctly under scalableminds chatroom.

Other markdown output (emphasis, strong and tables) seems to be rendering correctly.

@netcarver
Copy link

netcarver commented Mar 5, 2019

@MatthieuJnon Perhaps this line might be the problem. Looks like it ignores the title in the renderer.

Update: Confirmed. Commenting out lines 27-30 restores expected rendering of links.

@MatthieuJnon
Copy link
Contributor

You're absolutely right, i'll fix this in a few hours

@netcarver
Copy link

@MatthieuJnon Hi Matthieu, thank you - that would be appreciated!

I think I spoke too soon about no other problems with the Markdown rendering - there seems to be an issue with converting newlines in bot replies to html breaks as well. Will look to open a separate issue for that later.

@MatthieuJnon
Copy link
Contributor

The named link issue has been fixed in the latest version 0.5.6, thank you for your documentation of the issue.
And please do open an other issue on that newline to html breaks problem.

@khldOdoo
Copy link

How can i embed an iFrame ? i am trying to respond with google maps but it doesnt seem to accept iframe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants