Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: kbd tag show as text

shuai1712a1ab19c0
diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts
index e54f6cba..32ad2159 100644
--- a/ui/src/utils/common.ts
+++ b/ui/src/utils/common.ts
@@ -173,6 +173,8 @@ function diffText(newText: string, oldText: string): string {
if (typeof oldText !== 'string') {
return newText
?.replace(/\n/gi, '<br>')
+ ?.replace(/<kbd/gi, '&lt;kbd')
+ ?.replace(/<\/kbd>/gi, '&lt;/kbd&gt;')
?.replace(/<iframe/gi, '&lt;iframe')
?.replace(/<input/gi, '&lt;input');
}