Skip to content

Releases: darkmavis1980/markdown-index-generator

v3.2.1

29 Aug 09:32

Choose a tag to compare

Fix: Inconsistent TOC generation due to line endings

This PR resolves issue #74, where the Table of Contents (TOC) was being generated inconsistently, particularly on macOS environments. The root cause was identified as the parser's assumption of \n line endings, which failed to account for files with \r\n or \r.

Changes Made

  • Normalized Line Endings: The MarkdownParser now normalizes line endings by replacing \r\n and \r with \n before splitting the file content into lines. This ensures consistent parsing across all operating systems.
  • Added Test Case: A new test has been added to specifically verify that the parser correctly handles mixed line endings (\n, \r\n, and \r), preventing future regressions.

With these changes, the TOC generation is now consistent and reliable, regardless of the file's line endings.

v3.2.0

12 Aug 15:49

Choose a tag to compare

🚀 Release v3.2.0: Enhanced Markdown Parsing and Permalink Generation

📋 Overview

This release introduces significant improvements to the Markdown parsing capabilities and permalink generation, along with comprehensive dependency updates and enhanced test coverage.

✨ What's New

🔧 Enhanced Markdown Parser

  • Improved heading extraction: Better handling of complex heading structures
  • Enhanced code block handling: More robust parsing of code blocks within markdown content
  • Streamlined whitespace management: Consistent handling of various whitespace patterns

Advanced Permalink Generation

  • HTML tag support: The stringToPermalink function now properly handles HTML tags
  • Markdown link processing: Improved handling of markdown link syntax
  • Trailing hyphen removal: Cleaner permalink generation by removing trailing hyphens

Test Improvements

  • Consistent test cases: Updated test scenarios for better reliability
  • Code cleanup: Removed unused imports and improved test structure
  • Enhanced coverage: Better test coverage for edge cases

Dependency Updates

  • Latest TypeScript: Updated to TypeScript 5.9.2
  • Modern ESLint: Upgraded to ESLint 9.33.0 with latest TypeScript-ESLint
  • Performance improvements: Updated tsx, Jest, and other development dependencies

🔍 Technical Details

Files Modified

  • src/classes/markdown.ts - Enhanced MarkdownParser functionality
  • src/lib/utils.ts - Improved permalink generation
  • test/__mocks__/test.md - Updated test data
  • test/esm-compatibility.test.ts - Enhanced ESM testing
  • test/lib/tags.test.ts - Improved tag parsing tests
  • package.json & package-lock.json - Dependency updates
  • CHANGELOG.md - Release documentation

Breaking Changes

None - this is a backward-compatible release.

Quality Assurance

  • ✅ All existing tests pass
  • ✅ New test cases added for enhanced functionality
  • ✅ Code follows project linting standards
  • ✅ ESM compatibility maintained
  • ✅ Node.js 22+ compatibility ensured

📈 Impact

This release improves the reliability and robustness of markdown parsing, making the tool more suitable for complex markdown documents with various formatting patterns. The enhanced permalink generation ensures cleaner, more consistent output for generated indexes.

🔗 Related

  • Version: 3.2.0
  • Branch: bugfix/fix-issue-77
  • Previous: v3.1.4

v3.1.4

08 Aug 09:44

Choose a tag to compare

Changes

  • fix: issue #75
  • test: add unit test to cover issue

v3.1.3

08 Aug 09:24

Choose a tag to compare

Changes

  • fix: updated list of node.js runtime versions
  • fix: compatibility issue with ts-jest
  • chore: update all dependencies to latest version

v3.1.2

30 Apr 10:07

Choose a tag to compare

Fix issue with spaces in headings and multi-digit numbered lists

Summary

This PR addresses two key issues in the Markdown Index Generator:

  • Improves whitespace handling in headings to ensure proper normalization
  • Fixes a bug in the numbered list detection that failed to recognize multi-digit numbers (e.g., "10.")

Changes

  • Updated the regex pattern in getListStyle method to use \d+ instead of \d to match multiple digits
  • Enhanced whitespace handling in parseHeadings by adding proper normalization with replace(/\s+/g, ' ')
  • Added comprehensive unit tests for:
    • Headings with excessive whitespace
    • Multi-digit numbered list detection
    • Whitespace normalization
    • Custom title filtering

Testing

All tests are passing, including the new tests specifically created to verify these fixes.

Related Issue

Closes #70

v3.1.1

25 Apr 10:59

Choose a tag to compare

Fix issue with headings containing extra whitespace

Problem

The markdown index generator wasn't properly handling headings that contained multiple consecutive whitespace characters (spaces, tabs, newlines). This resulted in invalid permalinks with multiple hyphens or inconsistent formatting.

Solution

This PR adds proper whitespace handling to the stringToPermalink function:

  1. Added .trim() to remove leading and trailing whitespace
  2. Added .replace(/\s+/g, ' ') to replace multiple whitespace characters with a single space
  3. Enhanced existing tests and added new tests specifically for whitespace handling

Changes

  • Fixed whitespace normalization in the stringToPermalink function
  • Added comprehensive test suite for whitespace handling in headings
  • Added additional tests to validate ESM compatibility and import paths
  • Ensured formatting consistency throughout the codebase
  • Fix issue with workflows

Test Cases Added

  • Multiple spaces within headings
  • Tabs in headings
  • Newlines in headings
  • Leading and trailing whitespace in headings

Related Issues

Fixes Issue #70

Version

This is a bugfix that should be released as version 3.1.1

v3.1.0

25 Apr 10:02

Choose a tag to compare

Refactor Build Process and Fix ESM Compatibility

Overview

This PR updates the project to properly support ESM modules with proper import/export paths, fixing compatibility issues between Node.js environments including Windows WSL.

Changes

ESM Module Compatibility

  • Added .js extensions to all import paths in TypeScript files
  • Updated tsconfig.json to use NodeNext for module resolution
  • Fixed exports to ensure proper ESM compatibility
  • Fixed shebang in bin/run to work across different environments including Windows WSL

Testing Infrastructure

  • Updated Jest configuration to work with ES modules
  • Added NODE_OPTIONS=--experimental-vm-modules to test scripts
  • Imported Jest from @jest/globals in test files to support ESM compatibility

Export Consistency

  • Removed conflicting export patterns in markdown.ts
  • Standardized named exports across the codebase

Testing

  • All tests are passing with the updated configuration
  • The library now correctly builds with TypeScript to ESM-compatible JavaScript
  • Fixed import paths to ensure compatibility when used as a dependency

Impact

These changes resolve issues where:

  1. The library would fail when imported in other ESM projects
  2. The library wouldn't work correctly in Windows WSL environments
  3. Module paths were resolved incorrectly (e.g. /lib/lib/utils instead of /lib/utils)

Version

Bumped version to 3.1.0 as these changes include significant internal improvements but don't break the external API.

v3.0.3

22 Apr 10:24

Choose a tag to compare

Changes

  • fix: issue with CLI execution under Windows WSL reported in issue #68
  • fix: set TS to use ESModules instead of CommonJS

v3.0.1

29 Mar 11:58

Choose a tag to compare

Changes

  • fix: issue with TS configuration during publishing

v3.0.0

29 Mar 11:51

Choose a tag to compare

Changes

  • feat!: dropped support for node.js 18.x, supported versions are 20.x and above
  • feat: update ESLint to version 9
  • feat: added prettier for formatting
  • feat: replaced runtime for CLI
  • fix: removed mocha configuration
  • fix: various configurations
  • chore: update dependencies