Skip to content

Commit

Permalink
fix: remove decodeURI for avoid URI malformed (#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Mar 20, 2024
1 parent 9b41da5 commit f75d7e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions web/screens/Chat/SimpleTextMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 78,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
?.apply(this, [href, title, text])
.replace('<a', "<a target='_blank'")
},
code(code, lang, escaped) {
code(code, lang) {
return `
<div class="relative code-block group/item">
<button class='text-xs copy-action hidden group-hover/item:block bg-gray-950 hover:bg-gray-950/90 text-gray-200 p-2 rounded-lg absolute top-6 right-2' >
Expand All @@ -89,9 89,7 @@ const SimpleTextMessage: React.FC<ThreadMessage> = (props) => {
}
</button>
<pre class="hljs">
<code class="language-${lang ?? ''}">${
escaped ? code : decodeURIComponent(code)
}</code>
<code class="language-${lang ?? ''}">${code}</code>
</pre>
</div>
`
Expand Down

0 comments on commit f75d7e3

Please sign in to comment.