INNER CODE UNIT · TypeScript

candidateStart

RyanYipeng/SyncCaster · apps/extension/src/content-scripts/index.ts:387

          const candidateStart = estimatedHalf + delta;
          if (candidateStart > 0 && candidateStart < firstSpecialIdx) {
            const candidateLatex = text.substring(candidateStart);
            const renderText = text.substring(0, candidateStart);
            if (candidateLatex.length > 0 && renderText.length > 0) {
              const matchLen = Math.min(3, renderText.length, candidateLatex.length);
              if (renderText.substring(0, matchLen) === candidateLatex.substring(0, matchLen)) {
                latexStart = candidateStart;
                console.log('[math] Found LaTeX start via half-point search:', latexStart);
                break;
              }
            }
          }
        }
        if (latexStart >= 0) break;
      }
    }
    

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…