MCPcopy Create free account
hub / github.com/crisxuan/bestJavaer / findSidebarLink

Function findSidebarLink

assets/article-cards.js:290–300  ·  view source on GitHub ↗
(sidebar, item, handledLinks)

Source from the content-addressed store, hash-verified

288 }
289
290 function findSidebarLink(sidebar, item, handledLinks) {
291 var hrefs = [item.enHref, item.zhHref].map(normalizeHashHref);
292 var texts = [item.enText, item.zhText];
293
294 return Array.from(sidebar.querySelectorAll('a[href]')).find(function (link) {
295 var href = normalizeHashHref(link.getAttribute('href') || '');
296 var text = link.textContent.trim();
297
298 return handledLinks.indexOf(link) === -1 && (hrefs.indexOf(href) !== -1 || texts.indexOf(text) !== -1);
299 });
300 }
301
302 function localizeSidebarGroupLabels(sidebar, locale) {
303 var replacements = {};

Callers 1

localizeSidebarFunction · 0.85

Calls 1

normalizeHashHrefFunction · 0.85

Tested by

no test coverage detected