# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2026-02-25

### Security

- **Dependency vulnerability fixes**: Resolved 6 npm audit vulnerabilities (1 critical, 1 high, 3 moderate, 1 low)
  - `basic-ftp` critical path traversal (CVE in `downloadToDir()`)
  - `minimatch` high ReDoS via repeated wildcards
  - `markdown-it` moderate ReDoS
  - `ajv` moderate ReDoS with `$data` option
  - `lodash-es` moderate prototype pollution in `_.unset`/`_.omit`
  - `diff` (jsdiff) DoS in `parsePatch`/`applyPatch`

- **XSS prevention in Mermaid renderer**: Diagram content is now base64-encoded and decoded in the browser context instead of being injected raw into HTML templates
- **JS injection prevention**: Mermaid theme and fontFamily options are now validated/sanitized before interpolation into JavaScript contexts
- **HTML escaping in error fallbacks**: Mermaid error fallback HTML now escapes diagram content and error messages
- **HTML escaping in markdown parser**: Custom container titles, details/summary titles, and the default fence fallback now properly escape HTML entities
- **Image path traversal protection**: `processImages` now validates that resolved image paths stay within the document's base directory
- **Puppeteer hardening**: Added additional Chrome launch flags (`--disable-extensions`, `--disable-background-networking`, `--disable-sync`, `--disable-translate`, `--no-first-run`, etc.) to both PDF and Mermaid browser instances
- **Security documentation**: Added inline comment in markdown parser noting that `html: true` is required for GFM but untrusted input should be sanitised

## [1.1.0] - 2026-01-11

### Added
- **Full-width Gantt chart rendering**: Gantt charts now span the entire page width
  - Configured ganttConfig in Mermaid initialization with `useWidth` parameter
  - Optimized padding and margins for better Gantt diagram display
  - Enhanced CSS for `.mermaid-container.gantt` to prevent width constraints

- **Official Mermaid theme rendering**: Use official Mermaid themes and validate user selection
  - Removed custom CSS and theme overrides for Mermaid
  - Dark-mode themes (`github-dark`, `vscode-dark`) use Mermaid's `dark` theme
  - Light/default themes (`github`, `github-light`, `vscode-light`) use Mermaid's `default` theme
  - Validate Mermaid theme names; allowed themes: `default`, `forest`, `dark`, `neutral`, `base`
  - Invalid themes now log a warning and fallback to `default`

- **Modular CSS rendering architecture**: Improved code organization
  - Extracted base document CSS into separate `base-styles.ts` module
  - Extracted KaTeX styles into separate `katex-styles.ts` module
  - Reduced `html-renderer.ts` complexity for better maintainability
  - Each CSS module independently testable and reusable

- **Render YAML front matter as an HTML table**: Render YAML front matter as an HTML table in generated PDFs for clearer metadata presentation ([963b163](https://github.com/anuragkr29/md-preview-pdf/commit/963b163)).

- **Enhanced security measures**:
  - Added SRI (Subresource Integrity) hashes to all CDN resources for tamper detection
  - Implemented HTML escaping for document title field to prevent XSS
  - Changed Mermaid security level from `'loose'` to `'antiscript'` for safer diagram rendering
  - Added validation for custom CSS paths to prevent path traversal attacks
  - Added executable path validation for Chrome/Chromium detection

### Improved
- **Code organization**: CSS generation logic separated into focused modules
  - Better separation of concerns
  - Easier to locate and modify specific CSS rules
  - Improved code reusability

### Fixed
- Rendering issues for the `github-dark` theme in generated PDFs; removed unused variables and minor cleanups ([e88e723](https://github.com/anuragkr29/md-preview-pdf/commit/e88e723)).

### CI / Tests
- Added Node 24.x to the GitHub Actions Node matrix (see `.github/workflows/ci.yml`) ([3390c1b](https://github.com/anuragkr29/md-preview-pdf/commit/3390c1b)).
- Increased Jest timeout to 120s for PDF generation tests to reduce flaky failures (tests/margin-verification.test.ts) ([3390c1b](https://github.com/anuragkr29/md-preview-pdf/commit/3390c1b)).

### Chore
- Regenerated sample PDFs and updated documentation/changelog metadata ([eebc2d0](https://github.com/anuragkr29/md-preview-pdf/commit/eebc2d0)).

## [1.0.6] - 2026-01-05

### 🔧 Fixed

#### System Chrome Fallback for Older OS Versions
- **Issue**: Bundled Chromium failed on macOS 10.x (Catalina and older) with error: `dyld: cannot load 'Google Chrome for Testing' (load command 0x80000034 is unknown)`
- **Root Cause**: Chrome for Testing binaries require macOS 11+ / Windows 10 1809+. Older systems are incompatible.
- **Solution**: Implemented automatic fallback to system-installed Chrome when bundled Chromium fails
  - Automatically detects Chrome installation at common paths
  - Supports environment variable `PUPPETEER_EXECUTABLE_PATH` for custom Chrome location
  - Falls back gracefully with clear error messages if no Chrome found
  - Works on macOS, Windows, and Linux

#### Compatibility Improvements
- Added `findSystemChrome()` function that checks:
  - Environment variable `PUPPETEER_EXECUTABLE_PATH`
  - Common Chrome installation paths (macOS, Windows, Linux)
  - System PATH using `which` (Unix) or `where` (Windows) commands
- Enhanced browser launch with try-catch fallback mechanism
- Improved error messages with actionable troubleshooting steps

### 📚 Documentation

#### System Requirements (README.md)
- **macOS**: Minimum macOS 11 (Big Sur). For macOS 10.x, install Google Chrome manually.
- **Windows**: Minimum Windows 10 (version 1809). Older versions need manual Chrome installation.
- **Linux**: Ubuntu 18.04+, Debian 10+, Fedora 32+, and most modern distributions.
- Added memory requirements: 512MB minimum, 1GB+ recommended.

#### Troubleshooting Guide (README.md)
New comprehensive troubleshooting section covering:
- "dyld: cannot load" error on macOS (Chrome installation solution)
- "Failed to launch browser" on Windows (Chrome path configuration)
- Missing dependencies on Linux (package installation commands)
- Out of memory errors (Node.js memory limits)
- Slow performance tips (feature toggles)
- How to get help (issue reporting guidelines)

#### Why This Happens
- **Chromium Compatibility**: Puppeteer downloads Chrome for Testing which has minimum OS requirements
- **macOS 10.x limitation**: Apple's dyld (dynamic linker) in macOS 10.x doesn't support load command 0x80000034 used by modern Chrome builds
- **Windows limitation**: Modern Chrome requires Windows 10 1809+ for certain APIs
- **Solution**: System-installed Chrome has broader OS compatibility and is updated independently

### ✅ Testing
- ✅ Verified on macOS 11+: Bundled Chromium works
- ✅ Verified fallback on older systems: System Chrome detected and used
- ✅ Tested environment variable override
- ✅ Tested error handling when no Chrome available

### 🎯 Supported Systems

| OS | Minimum Version | Notes |
|----|----------------|-------|
| macOS | 11 (Big Sur) | Older versions: install Chrome manually |
| Windows | 10 (1809) | Older versions: install Chrome manually |
| Linux | Ubuntu 18.04+, Debian 10+ | Most modern distributions supported |

### 🔗 Related Links
- [Puppeteer System Requirements](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md)
- [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/)
- [Google Chrome Download](https://www.google.com/chrome/)

---

## [1.0.5] - 2026-01-05

### 🎉 First Official Release with read me updated

This is the first stable release of MD Preview PDF Converter with comprehensive Markdown to PDF conversion capabilities.

### ✨ Features

#### Core Capabilities
- **Full GFM Support**: Complete GitHub Flavored Markdown support including tables, strikethrough, autolinks
- **Mermaid Diagrams**: Flowcharts, sequence diagrams, class diagrams, state diagrams, and more
- **Syntax Highlighting**: 150+ programming languages with beautiful color themes
- **Math Equations**: Full LaTeX math rendering via KaTeX ($inline$ and $$block$$)
- **Emoji Support**: GitHub-style emoji conversion (`:emoji:` syntax)
- **Task Lists**: Interactive checkbox support for TODO lists
- **Footnotes**: Complete footnote and reference support
- **Custom Containers**: Tips, warnings, danger, info, note, important, and caution boxes
- **Table of Contents**: Auto-generated with customizable heading depth (1-6)
- **Anchors**: Automatic heading anchors for linking
- **Front Matter**: YAML front matter parsing for document metadata

#### Theming & Customization
- **4 Built-in Themes**:
  - GitHub Light (`github`) - Default, clean professional look
  - GitHub Dark (`github-dark`) - Dark mode with full background coverage
  - VS Code Light (`vscode-light`) - VS Code inspired light theme
  - VS Code Dark (`vscode-dark`) - VS Code inspired dark theme
- **Custom CSS**: Support for custom CSS file injection
- **Responsive Rendering**: Automatic page layout adaptation
- **Custom Headers/Footers**: HTML templates for page headers and footers

#### Page Layout & Export
- **Multiple Page Formats**: A4, A3, A5, Letter, Legal, Tabloid
- **Custom Margins**: Fully customizable via CLI (`--margin`)
- **Orientation**: Portrait and landscape support
- **Page Numbers**: Optional page numbering in footer
- **HTML Export**: Simultaneous HTML output option
- **Background Printing**: Control over background color/image printing

#### CLI & API
- **Command Line Interface**: Full-featured CLI with 15+ options
- **Node.js Module API**: Three export modes:
  - `convert()` - Quick conversion function
  - `Converter` class - Flexible instance-based API
  - `convertString()` - Direct markdown string to PDF buffer
- **Verbose Logging**: Debug mode with detailed conversion logs

### 🔧 Technical Improvements

#### Dark Theme Rendering
- Fixed CSS stylesheet parsing to properly apply theme backgrounds to entire page
- Dark theme backgrounds now extend to page edges with no white borders
- Proper margin handling using CSS padding instead of PDF margins
- Sub-pixel rendering artifacts eliminated via viewport optimization

#### Margin & Padding System
- Redesigned margin handling for better control
- All margins handled via CSS padding on `.markdown-body`
- Background colors extend to page edges (no white borders)
- Default margins optimized at 10mm for professional appearance
- Custom margin support with format flexibility (`20mm` or `10mm,15mm,20mm,15mm`)

#### PDF Generation
- Viewport set to A4 page dimensions (800x1200px) for consistency
- Proper font loading and image embedding
- Optimized Mermaid diagram rendering in browser
- Comprehensive error handling with graceful fallbacks

#### Code Quality
- **Type Safety**: Full TypeScript with strict typing throughout
- **ESLint**: 0 warnings with complete type coverage
- **Tests**: 30 passing tests covering all major features
- **Dependencies**: 0 npm deprecation warnings, clean dependency tree

### 📦 Build & Distribution
- **Compiled Output**: TypeScript compiled to JavaScript for distribution
- **CLI Executable**: Global installation support via npm
- **Source Maps**: Full debugging support with sourcemap generation
- **Module Exports**: ESM/CommonJS compatible exports

### 🧪 Testing & Verification

**Unit Tests: 30/30 Passing** ✅
- Markdown parsing (12 tests)
- Front matter (2 tests)
- Converter operations (2 tests)
- Integration tests (3 tests)
- Feature coverage (11 tests)

**CLI Validation: 11/11 Passing** ✅
- Basic conversion
- Theme selection (4 themes)
- Table of Contents
- Custom margins
- HTML output
- Page numbers
- Feature toggles
- Page formats
- Landscape orientation

**Module API: 5/5 Passing** ✅
- Quick convert function
- Converter class with options
- TOC generation
- Markdown string conversion
- Multiple theme rendering

**Feature Verification: 14/14 Passing** ✅
- All features listed in README verified
- All documentation examples tested
- Architecture diagram components validated

### 📋 CLI Reference

**Basic Usage**
```bash
md-preview-pdf document.md
md-preview-pdf document.md output.pdf
```

**Common Options**
```bash
--theme <theme>          # github, github-dark, vscode-light, vscode-dark
--toc                    # Generate table of contents
--margin <size>          # Custom margins (e.g., 25mm or 10mm,15mm,20mm,15mm)
--page-numbers           # Add page numbers to footer
--format <format>        # A4, A3, A5, Letter, Legal, Tabloid
--landscape              # Landscape orientation
--html                   # Also output HTML file
--no-math                # Disable KaTeX rendering
--no-emoji               # Disable emoji conversion
--no-highlight           # Disable syntax highlighting
```

**List Available Themes**
```bash
md-preview-pdf themes
```

### 🚀 Node.js API

```typescript
import { Converter, convert, convertString } from 'md-preview-pdf';

// Quick convert
await convert('input.md', 'output.pdf', { theme: { name: 'github-dark' } });

// Converter class
const converter = new Converter({ theme: { name: 'github-dark' }, toc: true });
await converter.convertFile('input.md', 'output.pdf');
await converter.cleanup();

// String to PDF
const pdfBuffer = await convertString('# Hello\nWorld', { theme: { name: 'github' } });
```

### 💻 System Requirements
- **Node.js**: >= 18.0.0
- **npm**: >= 8.0.0
- **Chromium**: Automatically downloaded by Puppeteer
- **Memory**: 512MB minimum (1GB+ recommended for large documents)

### 📄 Documentation
- **README.md**: Quick start guide and feature overview
- **ARCHITECTURE.md**: Detailed system design and component breakdown
- **CONTRIBUTING.md**: Contribution guidelines
- **CODE_OF_CONDUCT.md**: Community standards

### 🐛 Known Limitations
- Sub-pixel rendering may produce minimal artifacts on PDF edges (Puppeteer limitation)
- Very large documents (1000+ pages) may require increased memory
- Some rare CSS edge cases may not render identically to web browsers
- Mermaid diagram complexity is limited by browser rendering

### 🎯 Performance Benchmarks
- Simple markdown file: ~2.1 seconds
- Comprehensive document: ~40 seconds
- Small document PDF: 100-150 KB
- Typical document PDF: 500KB-2MB

### ✅ Verification Checklist
- ✅ Build: 0 errors
- ✅ Linting: 0 errors, 0 warnings
- ✅ Tests: 30/30 passing
- ✅ npm audit: 0 vulnerabilities
- ✅ CLI: All commands working
- ✅ API: All methods functional
- ✅ Themes: All 4 rendering correctly
- ✅ Features: 14/14 verified
- ✅ Documentation: Complete and tested

### 🙏 Attribution
- Built with [Puppeteer](https://github.com/puppeteer/puppeteer) for PDF generation
- [markdown-it](https://github.com/markdown-it/markdown-it) for parsing
- [highlight.js](https://highlightjs.org/) for syntax highlighting
- [KaTeX](https://katex.org/) for math rendering
- [Mermaid](https://mermaid.js.org/) for diagrams

---

## [1.0.4] - 2026-01-05

### 🎉 First Official Release

This is the first stable release of MD Preview PDF Converter with comprehensive Markdown to PDF conversion capabilities.

### ✨ Features

#### Core Capabilities
- **Full GFM Support**: Complete GitHub Flavored Markdown support including tables, strikethrough, autolinks
- **Mermaid Diagrams**: Flowcharts, sequence diagrams, class diagrams, state diagrams, and more
- **Syntax Highlighting**: 150+ programming languages with beautiful color themes
- **Math Equations**: Full LaTeX math rendering via KaTeX ($inline$ and $$block$$)
- **Emoji Support**: GitHub-style emoji conversion (`:emoji:` syntax)
- **Task Lists**: Interactive checkbox support for TODO lists
- **Footnotes**: Complete footnote and reference support
- **Custom Containers**: Tips, warnings, danger, info, note, important, and caution boxes
- **Table of Contents**: Auto-generated with customizable heading depth (1-6)
- **Anchors**: Automatic heading anchors for linking
- **Front Matter**: YAML front matter parsing for document metadata

#### Theming & Customization
- **4 Built-in Themes**:
  - GitHub Light (`github`) - Default, clean professional look
  - GitHub Dark (`github-dark`) - Dark mode with full background coverage
  - VS Code Light (`vscode-light`) - VS Code inspired light theme
  - VS Code Dark (`vscode-dark`) - VS Code inspired dark theme
- **Custom CSS**: Support for custom CSS file injection
- **Responsive Rendering**: Automatic page layout adaptation
- **Custom Headers/Footers**: HTML templates for page headers and footers

#### Page Layout & Export
- **Multiple Page Formats**: A4, A3, A5, Letter, Legal, Tabloid
- **Custom Margins**: Fully customizable via CLI (`--margin`)
- **Orientation**: Portrait and landscape support
- **Page Numbers**: Optional page numbering in footer
- **HTML Export**: Simultaneous HTML output option
- **Background Printing**: Control over background color/image printing

#### CLI & API
- **Command Line Interface**: Full-featured CLI with 15+ options
- **Node.js Module API**: Three export modes:
  - `convert()` - Quick conversion function
  - `Converter` class - Flexible instance-based API
  - `convertString()` - Direct markdown string to PDF buffer
- **Verbose Logging**: Debug mode with detailed conversion logs

### 🔧 Technical Improvements

#### Dark Theme Rendering
- Fixed CSS stylesheet parsing to properly apply theme backgrounds to entire page
- Dark theme backgrounds now extend to page edges with no white borders
- Proper margin handling using CSS padding instead of PDF margins
- Sub-pixel rendering artifacts eliminated via viewport optimization

#### Margin & Padding System
- Redesigned margin handling for better control
- All margins handled via CSS padding on `.markdown-body`
- Background colors extend to page edges (no white borders)
- Default margins optimized at 10mm for professional appearance
- Custom margin support with format flexibility (`20mm` or `10mm,15mm,20mm,15mm`)

#### PDF Generation
- Viewport set to A4 page dimensions (800x1200px) for consistency
- Proper font loading and image embedding
- Optimized Mermaid diagram rendering in browser
- Comprehensive error handling with graceful fallbacks

#### Code Quality
- **Type Safety**: Full TypeScript with strict typing throughout
- **ESLint**: 0 warnings with complete type coverage
- **Tests**: 30 passing tests covering all major features
- **Dependencies**: 0 npm deprecation warnings, clean dependency tree

### 📦 Build & Distribution
- **Compiled Output**: TypeScript compiled to JavaScript for distribution
- **CLI Executable**: Global installation support via npm
- **Source Maps**: Full debugging support with sourcemap generation
- **Module Exports**: ESM/CommonJS compatible exports

### 🧪 Testing & Verification

**Unit Tests: 30/30 Passing** ✅
- Markdown parsing (12 tests)
- Front matter (2 tests)
- Converter operations (2 tests)
- Integration tests (3 tests)
- Feature coverage (11 tests)

**CLI Validation: 11/11 Passing** ✅
- Basic conversion
- Theme selection (4 themes)
- Table of Contents
- Custom margins
- HTML output
- Page numbers
- Feature toggles
- Page formats
- Landscape orientation

**Module API: 5/5 Passing** ✅
- Quick convert function
- Converter class with options
- TOC generation
- Markdown string conversion
- Multiple theme rendering

**Feature Verification: 14/14 Passing** ✅
- All features listed in README verified
- All documentation examples tested
- Architecture diagram components validated

### 📋 CLI Reference

**Basic Usage**
```bash
md-preview-pdf document.md
md-preview-pdf document.md output.pdf
```

**Common Options**
```bash
--theme <theme>          # github, github-dark, vscode-light, vscode-dark
--toc                    # Generate table of contents
--margin <size>          # Custom margins (e.g., 25mm or 10mm,15mm,20mm,15mm)
--page-numbers           # Add page numbers to footer
--format <format>        # A4, A3, A5, Letter, Legal, Tabloid
--landscape              # Landscape orientation
--html                   # Also output HTML file
--no-math                # Disable KaTeX rendering
--no-emoji               # Disable emoji conversion
--no-highlight           # Disable syntax highlighting
```

**List Available Themes**
```bash
md-preview-pdf themes
```

### 🚀 Node.js API

```typescript
import { Converter, convert, convertString } from 'md-preview-pdf';

// Quick convert
await convert('input.md', 'output.pdf', { theme: { name: 'github-dark' } });

// Converter class
const converter = new Converter({ theme: { name: 'github-dark' }, toc: true });
await converter.convertFile('input.md', 'output.pdf');
await converter.cleanup();

// String to PDF
const pdfBuffer = await convertString('# Hello\nWorld', { theme: { name: 'github' } });
```

### 💻 System Requirements
- **Node.js**: >= 18.0.0
- **npm**: >= 8.0.0
- **Chromium**: Automatically downloaded by Puppeteer
- **Memory**: 512MB minimum (1GB+ recommended for large documents)

### 📄 Documentation
- **README.md**: Quick start guide and feature overview
- **ARCHITECTURE.md**: Detailed system design and component breakdown
- **CONTRIBUTING.md**: Contribution guidelines
- **CODE_OF_CONDUCT.md**: Community standards

### 🐛 Known Limitations
- Sub-pixel rendering may produce minimal artifacts on PDF edges (Puppeteer limitation)
- Very large documents (1000+ pages) may require increased memory
- Some rare CSS edge cases may not render identically to web browsers
- Mermaid diagram complexity is limited by browser rendering

### 🎯 Performance Benchmarks
- Simple markdown file: ~2.1 seconds
- Comprehensive document: ~40 seconds
- Small document PDF: 100-150 KB
- Typical document PDF: 500KB-2MB

### ✅ Verification Checklist
- ✅ Build: 0 errors
- ✅ Linting: 0 errors, 0 warnings
- ✅ Tests: 30/30 passing
- ✅ npm audit: 0 vulnerabilities
- ✅ CLI: All commands working
- ✅ API: All methods functional
- ✅ Themes: All 4 rendering correctly
- ✅ Features: 14/14 verified
- ✅ Documentation: Complete and tested

### 🙏 Attribution
- Built with [Puppeteer](https://github.com/puppeteer/puppeteer) for PDF generation
- [markdown-it](https://github.com/markdown-it/markdown-it) for parsing
- [highlight.js](https://highlightjs.org/) for syntax highlighting
- [KaTeX](https://katex.org/) for math rendering
- [Mermaid](https://mermaid.js.org/) for diagrams

---

## [1.0.3] - 2026-01-04

### Fixed
- **Eliminated all npm deprecation warnings using npm overrides**
  - Previously: `npm warn deprecated inflight@1.0.6` and `npm warn deprecated glob@7.2.3`
  - Root cause: `test-exclude@6.0.0` (used by babel-plugin-istanbul) depended on glob@7.2.3 and inflight@1.0.6
  - Solution: Added npm overrides to force `test-exclude@7.0.1` which uses `glob@10.5.0` (no inflight dependency)
  - Result: 0 npm deprecation warnings

### Changed
- **package.json**: Added `overrides` field with `test-exclude@^7.0.1`
  - This forces the latest test-exclude version across the entire dependency tree
  - Ensures no transitive deprecated dependencies are installed
  - npm overrides field is the official npm solution for this type of issue

### Improvements
- Complete elimination of npm deprecation warnings from direct and transitive dependencies
- Cleaner dependency tree with no memory-leaking modules (inflight is deprecated)
- Faster glob operations using modern glob@10 implementation
- All dependencies verified with `npm audit` (0 vulnerabilities)

### Verification
- ✅ Build: 0 errors
- ✅ Linting: 0 errors, 0 warnings
- ✅ Tests: 26/26 passing
- ✅ npm audit: 0 vulnerabilities
- ✅ npm ci: Clean install with 0 deprecation warnings
- ✅ npm ls: Correct dependency tree (test-exclude@7.0.1, glob@10.5.0, no inflight)
- ✅ CLI: All commands working correctly
- ✅ Programmatic API: All Converter methods functional

## [1.0.2] - 2026-01-04

### Fixed
- **Eliminated all ESLint warnings with proper type safety**
  - Previously: 15 ESLint warnings about "Unexpected any" types
  - Now: 0 ESLint warnings with full type safety
- Fixed CLI `mermaidTheme` option: Changed from `any` to proper `MermaidOptions['theme']` type
- Fixed markdown-it integration: Properly imported and used `Token`, `StateInline`, `StateBlock` types from markdown-it/lib
- Fixed all render rule callbacks: Now use proper `Renderer.RenderRule` type with correct function signatures
- Fixed unused function parameters: All unused parameters now properly prefixed with `_` prefix

### Changed
- **CLI Type Safety** (`src/cli.ts`):
  - Line 180: `mermaidTheme` now typed as `MermaidOptions['theme']` instead of `any`
  - Added import of `MermaidOptions` type for proper type checking
- **Markdown Parser Proper Typing** (`src/parser/markdown-parser.ts`):
  - Imported actual markdown-it types: `Token`, `StateInline`, `StateBlock`, `Renderer`
  - All render function callbacks now use `Renderer.RenderRule` type
  - Math render rules: `tokens: Token[]` with proper typing
  - Mermaid fence handler: Full type safety with `_options`, `_env`, `_self` parameters
  - Container render rules: Both standard containers and details/summary use proper types
  - All unused parameters properly marked with `_` prefix per ESLint conventions

### Improvements
- Complete elimination of ESLint warnings without using `eslint-disable` comments
- Improved code maintainability with proper TypeScript types throughout
- Better IDE support with full type inference for markdown-it integration
- All type imports come directly from markdown-it's official type definitions

### Verification
- ✅ Build: 0 errors
- ✅ Linting: 0 errors, 0 warnings (previously 15 warnings)
- ✅ Tests: 26/26 passing
- ✅ npm audit: 0 vulnerabilities

## [1.0.2] - 2026-01-04

### Fixed
- **Eliminated all ESLint warnings with proper type safety**
  - Previously: 15 ESLint warnings about "Unexpected any" types
  - Now: 0 ESLint warnings with full type safety
- Fixed CLI `mermaidTheme` option: Changed from `any` to proper `MermaidOptions['theme']` type
- Fixed markdown-it integration: Properly imported and used `Token`, `StateInline`, `StateBlock` types from markdown-it/lib
- Fixed all render rule callbacks: Now use proper `Renderer.RenderRule` type with correct function signatures
- Fixed unused function parameters: All unused parameters now properly prefixed with `_` prefix

### Changed
- **CLI Type Safety** (`src/cli.ts`):
  - Line 180: `mermaidTheme` now typed as `MermaidOptions['theme']` instead of `any`
  - Added import of `MermaidOptions` type for proper type checking
- **Markdown Parser Proper Typing** (`src/parser/markdown-parser.ts`):
  - Imported actual markdown-it types: `Token`, `StateInline`, `StateBlock`, `Renderer`
  - All render function callbacks now use `Renderer.RenderRule` type
  - Math render rules: `tokens: Token[]` with proper typing
  - Mermaid fence handler: Full type safety with `_options`, `_env`, `_self` parameters
  - Container render rules: Both standard containers and details/summary use proper types
  - All unused parameters properly marked with `_` prefix per ESLint conventions

### Improvements
- Complete elimination of ESLint warnings without using `eslint-disable` comments
- Improved code maintainability with proper TypeScript types throughout
- Better IDE support with full type inference for markdown-it integration
- All type imports come directly from markdown-it's official type definitions

### Verification
- ✅ Build: 0 errors
- ✅ Linting: 0 errors, 0 warnings (previously 15 warnings)
- ✅ Tests: 26/26 passing
- ✅ npm audit: 0 vulnerabilities

## [1.0.1] - 2026-01-04

### Fixed
- **Resolved all npm deprecation warnings from direct dependencies**
  - Previously warned about @humanwhocodes/config-array and @humanwhocodes/object-schema (ESLint v8 dependencies)
  - Previously warned about inflight, rimraf@3, glob@7, and eslint@8.57.1
- Upgraded ESLint from v8.57.0 → v9.0.0 (latest stable, fully supported)
- Upgraded @typescript-eslint/parser from v6.17.0 → v8.0.0 (latest compatible)
- Upgraded @typescript-eslint/eslint-plugin from v6.17.0 → v8.0.0 (latest compatible)
- Upgraded TypeScript from v5.3.3 → v5.4.5 (latest stable)
- Upgraded all other dev dependencies to latest stable versions
- Fixed ESLint configuration for v9 compatibility

### Changed
- **ESLint Configuration**: Migrated from old config format (.eslintrc.js) to new flat config format (eslint.config.js)
- ESLint config properly handles:
  - JavaScript config files (eslint.config.js, jest.config.js) with CommonJS require statements
  - TypeScript source files (src/**/*.ts) with full type checking
  - Test files (tests/**/*.ts) without type project validation
- Updated ECMAScript version target to 2024
- Added typescript-eslint package for proper ESLint v9 support
- Removed unused `convert` import from tests

### Improvements
- All direct npm dependencies now use latest stable versions with no known vulnerabilities
- ESLint security patches (v9 has critical security improvements over v8)
- Cleaner dependency management with no deprecated warnings from direct dependencies
- Better type safety and linting rules with @typescript-eslint v8

### Technical Details
**Transitive Dependencies Note:** Remaining npm warnings from `inflight@1.0.6` and `glob@7.2.3` are from transitive dependencies used by Jest. These are indirect and cannot be controlled directly (Jest still uses these older tools). No direct dependencies produce warnings.

**Verification:**
- ✅ All 26 tests passing
- ✅ Build successful with TypeScript 5.4.5
- ✅ ESLint: 0 errors (2 warnings are intentional: any type usage in CLI)
- ✅ npm audit: 0 vulnerabilities
- ✅ npm ci: Clean install with only transitive deprecation warnings

## [1.0.0] - 2026-01-03

### Added
- Initial release of MD Preview PDF
- Full GitHub Flavored Markdown (GFM) support
- Mermaid diagram rendering (flowcharts, sequence diagrams, class diagrams, etc.)
- Syntax highlighting for 150+ programming languages using highlight.js
- Math equation rendering with KaTeX
- Multiple themes: GitHub (light/dark), VS Code (light/dark)
- Auto-generated Table of Contents with customizable depth
- Task lists with checkbox support
- Footnotes support
- Custom containers (tips, warnings, info boxes)
- Emoji shortcode conversion
- Command-line interface with extensive options
- Programmatic API for integration
- YAML front matter support for document-specific configuration
- Custom CSS support
- Page number support
- Landscape and portrait orientation options
- Multiple page formats (A4, A3, A5, Letter, Legal, Tabloid)
- Customizable margins
- Debug mode for troubleshooting

### Fixed
- Missing headings in PDF output (critical bug fix)
- Excessive white space around Mermaid diagrams
- Excessive white space between sections
- Mermaid diagrams breaking across pages
- Headings appearing separately from their content
- Improved page break control for tables, images, and code blocks

### Technical
- TypeScript-based codebase for type safety
- Puppeteer for high-fidelity PDF generation
- Comprehensive test suite with Jest
- ESLint configuration for code quality
- Modular architecture with clear separation of concerns
- Async/await throughout for better performance
- Error handling and logging utilities

## [Unreleased]

### Planned
- Watch mode for automatic regeneration
- Batch conversion support
- Additional themes
- SVG optimization
- Custom font support
- Header/footer templates
- Watermark support
- PDF encryption and permissions
- Table of figures/tables
- Cross-references

---

[1.0.0]: https://github.com/anuragkr29/md-preview-pdf/releases/tag/v1.0.0
