fix action buttons in markdown
frdel committed
Jan 29, 2026 at 21:29 UTC
0135351b51648d34b06903961f18417a4e1dd2de
1 file changed
+15
-15
webui/js/messages.js
+15
-15
@@ -1564,15 +1564,15 @@ function adjustMarkdownRender(element) {
1564
// find all tables in the element
1565
const tables = element.querySelectorAll("table");
1566
tables.forEach((el) => {
1567
- // const wrapper = wrapElement(el, "message-markdown-table-wrap");
1568
- // const actionsDiv = document.createElement("div");
1569
- // actionsDiv.className = "step-action-buttons";
1570
- // actionsDiv.appendChild(
1571
- // createActionButton("copy", "", () =>
1572
- // copyToClipboard(extractTableTSV(el)),
1573
- // ),
1574
- // );
1575
- // wrapper.appendChild(actionsDiv);
1567
+ const wrapper = wrapElement(el, "message-markdown-table-wrap");
1568
+ const actionsDiv = document.createElement("div");
1569
+ actionsDiv.className = "step-action-buttons";
1570
+ actionsDiv.appendChild(
1571
+ createActionButton("copy", "", () =>
1572
+ copyToClipboard(extractTableTSV(el)),
1573
+ ),
1574
+ );
1575
+ wrapper.appendChild(actionsDiv);
1576
});
1577
1578
// find all code blocks
@@ -1580,12 +1580,12 @@ function adjustMarkdownRender(element) {
1580
codeElements.forEach((code) => {
1581
const pre = code.parentNode;
1582
const wrapper = wrapElement(pre, "code-block-wrapper");
1583
- // const actionsDiv = document.createElement("div");
1584
- // actionsDiv.className = "step-action-buttons";
1585
- // actionsDiv.appendChild(
1586
- // createActionButton("copy", "", () => copyToClipboard(code.textContent)),
1587
- // );
1588
- // wrapper.appendChild(actionsDiv);
1583
+ const actionsDiv = document.createElement("div");
1584
+ actionsDiv.className = "step-action-buttons";
1585
+ actionsDiv.appendChild(
1586
+ createActionButton("copy", "", () => copyToClipboard(code.textContent)),
1587
+ );
1588
+ wrapper.appendChild(actionsDiv);
1589
});
1590
1591
// find all images