skipSanitizationBoolean(default: false)

Controls whether HTML sanitization is skipped when rendering message content. When set to true, the Chat component will not automatically encode HTML entities in message text, allowing for rich HTML content to be displayed. This is useful when integrating with markdown parsers or when you need to display pre-formatted HTML content.

Warning: Setting this to true can introduce security vulnerabilities if user input is not properly sanitized elsewhere in your application. Only use this option when you trust the content source or have implemented your own sanitization logic.

Example

<div id="chat"></div>
<script>
let messagesData = [
    {
        id: 1,
        text: "<strong>Bold text</strong> and <em>italic text</em> will be rendered as HTML",
        authorId: "user1",
        authorName: "John Doe",
        authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/RICSU.jpg",
        timestamp: new Date(2026, 0, 1, 9, 0)
    },
    {
        id: 2,
        text: "Check out this <a href='https://example.com'>link</a> in my message!",
        authorId: "user2",
        authorName: "Jane Smith",
        authorImageUrl: "https://demos.telerik.com/kendo-ui/content/web/Customers/LONEP.jpg",
        timestamp: new Date(2026, 0, 1, 9, 5)
    }
];

$("#chat").kendoChat({
    skipSanitization: true,
    authorId: "user1",
    dataSource: messagesData
});
</script>
In this article
skipSanitization
Not finding the help you need?
Contact Support