Skip to content

Commit

Permalink
feat: decode http entities
Browse files Browse the repository at this point in the history
  • Loading branch information
PleahMaCaka committed Oct 31, 2023
1 parent 39e6064 commit 3f5dd62
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.5.0"
},
"dependencies": {
"html-entities": "^2.4.0"
}
}
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/lib/components/chat/messages/BaseMessage.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { decode } from "html-entities"
import { marked } from "marked"
export let profilePic: string
Expand All @@ -17,7 +18,7 @@
src={profilePic}
/>
<div class="chat-msg">
{@html marked(message)}
{@html decode(marked(message))}
</div>
</div>

Expand Down

0 comments on commit 3f5dd62

Please sign in to comment.