Skip to content

Strikethrough (<s>) is removed on sanitize #3565

@wvpm

Description

@wvpm

Version

https://cdn.botframework.com/botframework-webchat/4.10.1/webchat.js

Describe the bug

When sending markdown text "~~test~~" to the customer from the bot without a textFormat property in the activity (so it defaults to markdown), the WebChat shows "test" instead of "test".

Additional context

Based on https://github.com/microsoft/BotFramework-WebChat/blob/bbbaeb9c2c46ec61ad109c2dbce46099f87efeba/packages/bundle/src/renderMarkdown.js, I concluded that markdown-it is used to render the markdown. Note that strike is allowed as an html tag whilst s is not. According to https://github.com/markdown-it/markdown-it/blob/master/test/fixtures/markdown-it/strikethrough.txt markdown-it converts strikethrough into s. This is subsequently sanitized, which explains the behaviour I experience.

I would recommend added s to the allowed html tag list.

[Bug]

Metadata

Metadata

Assignees

Labels

Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.backlogOut of scope for the current iteration but it will be evaluated in a future release.bugIndicates an unexpected problem or an unintended behavior.customer-replied-toRequired for internal reporting. Do not delete.customer-reportedRequired for internal Azure reporting. Do not delete.front-burnerp0Must Fix. Release-blockersize-s1 days or less

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions