Fix toc for the webpage of the chapter of computational complexity
fix the math formula in TOC
before:
after:
fix both in English and Chinese chapter
Thanks for the PR!
I'm seeking a more elegant way to solve the latex rendering issue in the toc. Do you know how to solve this without adding the extra data-toc-label?
this is a problem with python-mardown used by mkdocs, related issues #849, #699
except data-toc-label, maybe you need to do more work, like writing extensions, ig
and ASAIK there is no perfect solution yet
here are two more possible solutions (maybe not that good):
1.use javaScript
write these codes to overrides/javascripts, tested and they works
document$.subscribe(function () {
document.querySelectorAll('.md-nav__link').forEach(function (link) {
// only remove the extra charcters when the toc contains sth like O(n) or O(\log n)
if (link.innerHTML.includes('O(')) {
link.innerHTML = link.innerHTML.replace(/\\\(/g, '').replace(/\\\)/g, '').replace(/\\/g, '');
}
});
});
2.programming a extension
lol, remove those \ or try to render them in nav, it's up to you
btw, in this pr i forgot the space in 平方阶 O(n^2), sry for that