mirror of https://github.com/istio/istio.io.git
Site improvements
- Fix highlighting of TOC entries in the Chinese version of the site. I wasn't doing the right escaping to deal with UTF-8 chars.
This commit is contained in:
parent
469667b184
commit
f124e190de
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -72,7 +72,7 @@ function handleCodeBlocks() {
|
|||
|
||||
const text = getToolbarDivText(div);
|
||||
let downloadas = code.dataset.downloadas;
|
||||
if (downloadas === undefined || downloadas === null || downloadas === "") {
|
||||
if (!downloadas || downloadas === "") {
|
||||
let lang = "";
|
||||
for (const cl of code.classList) {
|
||||
if (!cl) {
|
||||
|
|
|
@ -55,7 +55,7 @@ function handleLinks(): void {
|
|||
// Create the set of endnotes that expand URLs when printing
|
||||
function createEndnotes(): void {
|
||||
const notes = getById("endnotes");
|
||||
if (notes === null) {
|
||||
if (!notes) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ function handleScroll(): void {
|
|||
|
||||
for (let i = 0; i < tocLinks.length; i++) {
|
||||
const heading = tocHeadings[i];
|
||||
if (heading === null) {
|
||||
if (!heading) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ function handleScroll(): void {
|
|||
tocLinks = toc.getElementsByTagName("a");
|
||||
for (const link of tocLinks) {
|
||||
if (link) {
|
||||
const id = link.hash.substring(1);
|
||||
const id = decodeURIComponent(link.hash.substring(1));
|
||||
const hdr = getById(id);
|
||||
if (hdr) {
|
||||
tocHeadings.push(hdr);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Attach the event handlers to support the sidebar
|
||||
function handleSidebar(): void {
|
||||
const sidebar = getById("sidebar");
|
||||
if (sidebar === null) {
|
||||
if (!sidebar) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ function handleTabs(): void {
|
|||
|
||||
document.querySelectorAll(".tabset").forEach(tabset => {
|
||||
const strip = tabset.querySelector<HTMLElement>(".tab-strip");
|
||||
if (strip === null) {
|
||||
if (!strip) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue