Skip to content

Commit

Permalink
fix(webchat): make html escaping configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
allardy committed Feb 15, 2024
1 parent d9c2452 commit 2dd9a71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/webchat/src/components/messages/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Message extends Component<MessageProps> {
onAudioEnded: this.props.onAudioEnded,
shouldPlay: this.props.shouldPlay,
intl: this.props.store!.intl,
escapeHTML: true,
escapeHTML: this.props.store!.config.escapeHtml === undefined ? true : this.props.store!.config.escapeHtml,
showTimestamp: this.props.store!.config.showTimestamp!,
googleMapsAPIKey: this.props.store!.config.googleMapsAPIKey
}}
Expand Down
6 changes: 6 additions & 0 deletions packages/webchat/src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ export interface Config {
* Display's the webchat close button when the webchat is opened
*/
showCloseButton?: boolean
/**
* Replaces < and > with their HTML entities &lt; and &gt;.
* Setting it to false will let the markdown parser handle html itself
* @default true
*/
escapeHtml?: boolean
}

export interface BotDetails {
Expand Down

0 comments on commit 2dd9a71

Please sign in to comment.