Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
  • markdown-math.html

1 file changed

+9
-1
lines changed

markdown-math.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,22 @@

Generated HTML:

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)