Make code blocks focusable

This commit is contained in:
Lim Chee Aun 2023-09-02 20:49:25 +08:00
parent 3ac05d8cdd
commit 39d96f22a0

View file

@ -120,7 +120,7 @@ function enhanceContent(content, opts = {}) {
p.querySelectorAll('br').forEach((br) => br.replaceWith('\n'));
});
const codeText = nextParagraphs.map((p) => p.innerHTML).join('\n\n');
pre.innerHTML = `<code>${codeText}</code>`;
pre.innerHTML = `<code tabindex="0">${codeText}</code>`;
block.replaceWith(pre);
nextParagraphs.forEach((p) => p.remove());
}