Repository navigation
v0.4.10
🔧 Critical Bug Fix
Fixed heading-map preservation of deeply nested subsections (#### and beyond).
The Problem
Heading-map entries for #### subsections were being deleted during translation. The root cause was duplicate parsing logic:
parseDocumentComponents()used a simple 2-level parser (## and ### only)parseSections()had full recursive support (##-######)
This meant #### subsections were treated as content instead of structure, preventing them from being added to heading-maps.
The Solution
Refactored parseDocumentComponents() to call parseSections() internally:
- ✅ Eliminated duplicate parsing logic (DRY principle)
- ✅ Full recursive support for all nesting levels
- ✅ Single source of truth for parsing
Impact
- All 140 tests passing ✅
- No breaking changes - pure bug fix
- Bundle size: 1941kB (unchanged)
- Test coverage: Added 6 tests for #### and ##### changes
Files Modified
src/parser.ts- Unified parser implementationsrc/file-processor.ts- Removed 44 lines of debug loggingsrc/heading-map.ts- Removed 7 lines of verbose loggingpackage.json- Version bump to 0.4.10
Verification
Verified in GitHub test PR #316 (Real-world lecture update):
- Heading-map correctly includes
Vector Spaces::Basic Properties::Applications in Economics: 在经济学中的应用 - Document structure preserved at all nesting depths
Documentation
Full Changelog: v0.4.7...v0.4.10