fix ctrl-a fencing in codeblocks

This commit is contained in:
ed 2021-11-11 00:11:29 +01:00
parent 5533b47099
commit 5352f7cda7

View file

@ -2511,6 +2511,7 @@ var showfile = (function () {
wr.appendChild(el);
wr.style.display = '';
set_tabindex();
document.documentElement.scrollTop = 0;
var hfun = no_push ? hist_replace : hist_push;
@ -4736,14 +4737,12 @@ function show_md(md, name, div, url, depth) {
var els = QSA('#epi a');
for (var a = 0, aa = els.length; a < aa; a++) {
var href = els[a].getAttribute('href');
if (!href.startsWith('#'))
if (!href.startsWith('#') || href.startsWith('#md-'))
continue;
els[a].setAttribute('href', '#md-' + href.slice(1));
}
els = QSA('pre');
for (var a = 0, aa = els.length; a < aa; a++)
els[a].setAttribute('tabindex', '0');
set_tabindex();
}
catch (ex) {
toast.warn(10, errmsg + ex);
@ -4751,6 +4750,13 @@ function show_md(md, name, div, url, depth) {
}
function set_tabindex() {
var els = QSA('pre');
for (var a = 0, aa = els.length; a < aa; a++)
els[a].setAttribute('tabindex', '0');
}
function show_readme(md) {
if (!treectl.ireadme)
return;