botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

markdown doesn't allow IM hyperlink in webchat

Open Sams4u opened this issue 10 years ago • 7 comments

The hyperlink i am using has following syntax:- await context.PostAsync("Please click on HelpDesk"); But webchat is rendering it as

Please click on HelpDesk

At the same time emulator is picking it up correctly. I had raised a similar issue few days back, but closed by giving a link for markdown syntax. It seems like a bug. I have tried the same in different markdown online editors some produce expected HTML but others not. Attached the screenshot of an online markdown editor with similar behavior. image

Sams4u avatar Aug 29 '16 06:08 Sams4u

Does it only occur when the uri scheme is "sip" rather than "http"? I wonder if there is some url validation involved.

willportnoy avatar Aug 29 '16 20:08 willportnoy

yes i think. It works fine with mailto [mailto:[email protected]] as well. As of now problem is with sip and as you said some validation in the webchat window is preventing anchor tag to render properly.

Sams4u avatar Aug 30 '16 04:08 Sams4u

This is being filtered out by Angular's aHrefSanitizationWhitelist - we will look at the sip protocol to see if there are any security risks involved with enabling this. If so, this might need to be a user-configurable option in a future version of the webchat control.

danmarshall avatar Sep 06 '16 22:09 danmarshall

For future reference - it may be as easy as adding

      $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|sip):/);

in the config of app.js

danmarshall avatar Sep 06 '16 22:09 danmarshall

@danmarshall can you please comment further or close?

chrimc62 avatar Nov 26 '16 23:11 chrimc62

@Sams4u we have a new open-source version of our webchat control, which should enable this behavior. If you go to your bot's Channel config page for webchat, you can create a new site definition for a webchat and click the "webChat Preview" checkbox to get the new version.

danmarshall avatar Dec 16 '16 00:12 danmarshall

Closing as this has been fixed.

dandriscoll avatar Dec 21 '16 20:12 dandriscoll