fix: add configurability to search stop words#99
Conversation
|
Docs Site preview: https://7896a674.rockgarden.pages.dev |
There was a problem hiding this comment.
The CDN auto-detection and search stopwords features look well-implemented. The incremental build consistency bug (previous issue #2) is now properly fixed by including cdn_flags in the manifest. One previously-flagged regex issue at line 436 remains.
| # Resolve CDN auto-detection by scanning raw content | ||
| math_cdn = config.theme.math_cdn | ||
| if math_cdn == "auto": | ||
| _math_re = re.compile(r"\$\$|```math|\$[^\s\d$]") |
There was a problem hiding this comment.
Bug: Previously flagged and still present. \$[^\s\d$] still false-positives on shell variable names ($HOME, $PATH) and JS template literals (${x}), which are common in technical docs and will cause KaTeX to load unnecessarily on those pages. A tighter pattern that avoids matching $WORD (uppercase/lowercase identifier-style variables) would be r'\$\$|```math|(?<![\w])\$(?![\s\d\w])' — the (?![\w]) negative lookahead drops $VAR while still catching inline math like $x^2$ when followed by a math expression character.
No description provided.