Add a "copy" button below each message (#6654)

This commit is contained in:
oobabooga 2025-01-11 16:59:21 -03:00 committed by GitHub
parent 58342740a5
commit a5d64b586d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 104 additions and 26 deletions

View file

@ -3,7 +3,7 @@ import io
import requests
from modules import shared
from modules import shared, ui
from modules.logging_colors import logger
original_open = open
@ -58,6 +58,7 @@ def my_open(*args, **kwargs):
'\n <script src="file/js/morphdom/morphdom-umd.min.js"></script>'
f'\n <link id="highlight-css" rel="stylesheet" href="file/css/highlightjs/{"github-dark" if shared.settings["dark_theme"] else "github"}.min.css">'
'\n <script>hljs.addPlugin(new CopyButtonPlugin());</script>'
f'\n <script>{ui.global_scope_js}</script>'
'\n </head>'
)