Repository navigation
v1.1.1 - Critical Bug Fixes & Security Enhancements (2025-02-02)
Fixed
-
Critical: Pattern Matching Word Boundary Detection
- Fixed false positive pattern matching causing incorrect element removal
- Elements like
<section class="section-heading">were incorrectly treated as ads (contained "ad") - Implemented proper word boundary detection with separators:
-,_, space, tab - Text extraction from affected pages increased by 1,273x (87 → 111,010 characters)
-
Test Output Formatting
- Fixed
fmt.Printfmisuse that caused format errors with%characters - Prevented
%!f(MISSING),%!a(MISSING)errors in test output
- Fixed
-
Cache Double-Check Locking Race Condition
- Fixed potential race condition in cache Get method
- Properly re-checks entry after acquiring write lock
-
HTML Entity Parsing Logic
- Simplified numeric entity validation (removed redundant parsing)
- Eliminated unnecessary validation loops and goto statements
-
URI Security Validation
- Reordered checks to block dangerous protocols first (javascript:, vbscript:, file:)
- Fixed potential bypass through leading/trailing whitespace
- Corrected data URL character validation (was rejecting valid UTF-8)
Changed
- Code Quality
- Simplified re-exported types and constants (25 → 14 lines)
- Removed unused re-exports:
Tokenizer,ParseOption,ParseWithOptions, etc. - Cleaned up redundant comments throughout codebase
- Maintained 100% backward compatibility
Security
- Enhanced protocol validation order for safer URL handling
- Fixed data URL validation to properly handle base64-encoded content
- Corrected cache concurrency issues for thread-safe operation
Migration Notes
- Zero Breaking Changes - All existing API calls work without modification
- Tests: All existing tests pass successfully