Skip to content

Commit 5bb42ac

Browse files
committed
Fix code highlight rendering
1 parent 66a6de3 commit 5bb42ac

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/comment-widget/src/base-comment-item.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ export class BaseCommentItem extends LitElement {
121121
</div>
122122
123123
<div class="item-content mt-2.5 space-y-2.5 content">
124-
<slot name="pre-content"></slot>${unsafeHTML(sanitizeHtml(this.content))}
124+
<slot name="pre-content"></slot>${unsafeHTML(
125+
sanitizeHtml(this.content, {
126+
allowedAttributes: { code: ['class'] },
127+
})
128+
)}
125129
</div>
126130
127131
<div class="item-actions mt-2 flex items-center gap-3">

packages/comment-widget/src/reply-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class ReplyItem extends LitElement {
159159
slot="pre-content"
160160
@mouseenter=${() => this.handleSetActiveQuoteReply(this.quoteReply)}
161161
@mouseleave=${() => this.handleSetActiveQuoteReply()}
162-
class="quote-badge cursor-pointer inline-flex items-center gap-1 px-2.5 py-2 rounded-base bg-muted-3 text-text-2 hover:-translate-y-0.5 hover:text-text-1 hover:bg-muted-2 transition-all text-xs font-medium"
162+
class="quote-badge cursor-pointer inline-flex items-center gap-1 px-2 py-1.5 rounded-base bg-muted-3 text-text-2 hover:-translate-y-0.5 hover:text-text-1 hover:bg-muted-2 transition-all text-sm font-medium"
163163
><i class="i-ic:round-reply"></i><span>${this.quoteReply?.owner.displayName}</span>
164164
</span>
165165
<br slot="pre-content" />`

0 commit comments

Comments
 (0)