Skip to content

Commit ceff934

Browse files
authored
Better HTML export + no alert on copy button
1 parent 112b427 commit ceff934

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

markdown-math.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,22 @@ <h2>Generated HTML:</h2>
9797
],
9898
throwOnError: false
9999
});
100+
const copied = output.cloneNode(true);
101+
Array.from(copied.querySelectorAll('.katex-html')).forEach(el => {
102+
el.parentNode.removeChild(el);
103+
});
104+
htmlOutput.value = copied.innerHTML;
100105
}
101106

102107
input.addEventListener('input', renderContent);
103108

104109
copyButton.addEventListener('click', () => {
105110
htmlOutput.select();
106111
document.execCommand('copy');
107-
alert('HTML copied to clipboard!');
112+
copyButton.textContent = 'Copied!';
113+
setTimeout(() => {
114+
copyButton.textContent = 'Copy HTML';
115+
}, 2000);
108116
});
109117

110118
renderContent();

0 commit comments

Comments
 (0)