Skip to content

Commit 737ed7c

Browse files
committed
fix: escape raw html in message, fix #44, #43
1 parent 0e6efe7 commit 737ed7c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/components/Markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const parseMarkdown = (raw: string) => {
2020
.use(remarkParse)
2121
.use(remarkGfm)
2222
.use(remarkMath)
23-
.use(remarkRehype)
23+
.use(remarkRehype, { allowDangerousHtml: true })
2424
.use(rehypePrism, {
2525
ignoreMissing: true,
2626
})

src/components/StreamableText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default (props: Props) => {
4646

4747
return (
4848
<Markdown
49-
class={`prose prose-neutral dark:prose-invert fg-base! max-w-3xl -my-4 ${props.class ?? ''}`}
49+
class={`prose prose-neutral dark:prose-invert fg-base! max-w-3xl ${props.class ?? ''}`}
5050
text={localText()}
5151
showRawCode={props.showRawCode}
5252
/>

unocss.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export default defineConfig({
1717
presetIcons(),
1818
presetTypography({
1919
cssExtend: {
20+
'*:first-child': {
21+
'margin-top': 0,
22+
},
23+
'*:last-child': {
24+
'margin-bottom': 0,
25+
},
2026
'h1': {
2127
'font-size': '1.25em',
2228
'margin': '1rem 0',

0 commit comments

Comments
 (0)