Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
28ea56c9
"vscode:/vscode.git/clone" did not exist on "b29b7e557be954a0a5909a3fd25027652fd67e93"
Commit
28ea56c9
authored
Oct 24, 2023
by
Timothy J. Baek
Browse files
feat: copy code block added
parent
e509dafd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
src/routes/+page.svelte
src/routes/+page.svelte
+5
-2
No files found.
src/routes/+page.svelte
View file @
28ea56c9
...
...
@@ -123,7 +123,8 @@
blocks
.
forEach
((
block
)
=>
{
// only add button if browser supports Clipboard API
if
(
navigator
.
clipboard
)
{
if
(
navigator
.
clipboard
&&
block
.
childNodes
.
length
<
2
)
{
let
button
=
document
.
createElement
(
'
button
'
);
button
.
innerText
=
'
Copy Code
'
;
...
...
@@ -380,6 +381,7 @@
responseMessage
.
context
=
data
.
context
;
messages
=
messages
;
hljs
.
highlightAll
();
createCopyCodeBlockButton
();
}
}
}
...
...
@@ -477,6 +479,7 @@
responseMessage
.
context
=
data
.
context
;
messages
=
messages
;
hljs
.
highlightAll
();
createCopyCodeBlockButton
();
}
}
}
...
...
@@ -661,7 +664,7 @@
</div>
{:else}
<div
class=
"prose prose-invert prose-headings:my-0 prose-p:my-0 prose-pre:my-0 prose-table:my-0 prose-blockquote:my-0 prose-img:my-0 prose-ul:-my-2 prose-ol:-my-2 prose-li:-my-2 whitespace-pre-line"
class=
"prose
max-w-full
prose-invert prose-headings:my-0 prose-p:my-0 prose-pre:my-0 prose-table:my-0 prose-blockquote:my-0 prose-img:my-0 prose-ul:-my-2 prose-ol:-my-2 prose-li:-my-2 whitespace-pre-line"
>
{@html marked.parse(message.content)}
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment