Skip to content

Commit 96fd05c

Browse files
committed
Improve comment content formatting and code styling
1 parent 3065325 commit 96fd05c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,14 @@ export class BaseCommentItem extends LitElement {
121121
}
122122
</div>
123123
124-
<div class="item-content mt-2.5 space-y-2.5 content">
125-
<slot name="pre-content"></slot>${unsafeHTML(
126-
sanitizeHtml(this.content, {
127-
allowedAttributes: {
128-
...sanitizeHtml.defaults.allowedAttributes,
129-
code: ['class'],
130-
},
131-
})
132-
)}
124+
<div class="item-content mt-2.5 space-y-2.5 content"><slot name="pre-content"></slot>${unsafeHTML(
125+
sanitizeHtml(this.content, {
126+
allowedAttributes: {
127+
...sanitizeHtml.defaults.allowedAttributes,
128+
code: ['class'],
129+
},
130+
})
131+
)}
133132
</div>
134133
135134
<div class="item-actions mt-2 flex items-center gap-3">

packages/comment-widget/src/styles/content.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.content {
22
word-wrap: break-word;
3+
white-space: pre-wrap;
34
@apply text-text-1 text-sm leading-relaxed;
45
}
56

0 commit comments

Comments
 (0)