Skip to content

Commit d5574c9

Browse files
authored
webui: fix code copy stripping XML/HTML tags (ggml-org#18518)
* webui: fix code copy stripping XML/HTML tags * webui: update static build
1 parent 26831bd commit d5574c9

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

tools/server/public/index.html.gz

-21 Bytes
Binary file not shown.

tools/server/webui/src/lib/utils/clipboard.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ export async function copyCodeToClipboard(
6565
successMessage = 'Code copied to clipboard',
6666
errorMessage = 'Failed to copy code'
6767
): Promise<boolean> {
68-
const doc = new DOMParser().parseFromString(rawCode, 'text/html');
69-
const decodedCode = doc.body.textContent ?? rawCode;
70-
71-
return copyToClipboard(decodedCode, successMessage, errorMessage);
68+
return copyToClipboard(rawCode, successMessage, errorMessage);
7269
}
7370

7471
/**

0 commit comments

Comments
 (0)