Release notes · to-markdown
to-markdown Release Notes
Changelog for @cognipeer/to-markdown. For usage, see the to-markdown documentation.
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[3.6.1] - 2026-10
Fixed
- PPTX conversion now escapes backslashes in picture alt text as well as brackets, so affected slides produce valid Markdown image alt text
- DOCX, HTML, and EPUB conversions now rely on Turndown 7.2.3 or later so image alt text is escaped correctly in generated Markdown
Changed
- This patch release has no migration step, but operators should make sure the bundled or installed Turndown version is 7.2.3 or later when upgrading environments that convert DOCX, HTML, or EPUB files
[3.6.0] - 2026-10
Added
- Opt-in per-page PDF OCR (
ocr.pdfMode: 'auto-page'): only pages whose text layer is missing, garbled or too short are OCRed, the other pages keep their native text, and page order is preserved.pageTriggertunes the choice convertToMarkdownDetailed(input, options?)returns the same Markdown plus a report with each page's source and reason, each image's result, warnings, and OCR and render timings- OCR of embedded images in DOCX, PPTX and HTML through
ocr.embeddedImages, and animages: 'placeholder' | 'omit'option for how embedded images appear (EPUB images are not OCRed yet) - TIFF (including multi-page), WEBP and BMP image support, with EXIF auto-rotation before OCR (
ocr.autoRotate) - Richer OCR handlers (results can include
markdownandconfidence, handler context gainskind,index,sourcePath,slide,langHintandsignal),ocr.documentHandlerfor whole-PDF OCR, and pipeline controls such asmaxPages,concurrency,timeoutMs,signal,onProgressandonError - Tesseract options
langPath,cachePath,offline,psmandoem, plus ISO 639-1 language codes such as'tr+en'
Changed
- Behaviour notes for existing calls: VLM requests now send the image's real media type; failed VLM calls retry on 429, 5xx and network errors (default
retries: 2, setvlm.retries: 0to opt out); EXIF auto-rotation is on by default; Tesseractconcurrencyis capped at 4 - No breaking changes and no migration step are required for this release
Fixed
.tif,.tiff,.webpand.bmpfiles are no longer decoded as UTF-8 text- PPTX conversion no longer writes a temporary file into the working directory
[3.4.0] - 2026-09
Added
- Legacy Word
.docfiles are now supported as a direct conversion input alongside the library's existing document formats
Changed
- DOC conversion is safer, with updated handling for supported formats, conversion options, exported types, and conversion errors
- Callers can treat legacy DOC input as a first-class format in the documented API surface instead of relying on unsupported or ambiguous behavior
- No migration or special upgrade step is required for this release
[3.3.0] - 2026-08
Changed
- File conversion is more reliable for PDFs, images, and legacy Excel files, reducing incorrect handling in common file-detection and rendering paths
- YouTube and Bing pages are detected more accurately during conversion, so supported pages from those sources are more likely to use the intended conversion flow
- HTML table conversion now preserves backslashes and pipe characters correctly in Markdown output, reducing malformed table cells
- No migration or special upgrade step is required for this release
[3.2.1] - 2026-08
Changed
- Invalid PDF input now fails fast with an explicit conversion error instead of hanging during PDF conversion, making bad input easier to detect and handle in calling code
Breaking changes
- Callers that submit invalid PDF data should now handle an explicit conversion failure instead of waiting on a hung conversion
Fixes
- Tightened PDF input validation so non-PDF buffers fail immediately during conversion
[3.2.0] - 2026-08-17
Added
- OCR provider
'handler': pass a custom asynchandler(buffer, context)callback; the library performs no HTTP requests in this mode OCRHandler,OCRHandlerContext, andhandlerfield onOCROptions- OCR handler context includes page metadata (PDF), MIME hint, source extension, fileName, and image dimensions
[3.1.1] - 2026-08-03
Changed
music-metadatais now lazy-loaded (dynamicimport()) inside the audio converter instead of a top-level import, avoiding its startup cost for consumers that never process audio files
[3.1.0] - 2026-07-17
Fixed
- HTML to Markdown conversion no longer collapses tables, fenced code blocks, and ordered/nested lists onto a single line;
formatMarkdownis now structure-aware and preserves per-line formatting for tables, list items, blockquotes, headings, and horizontal rules - Ordered (
<ol>) and nested list numbering/indentation is preserved instead of flattening every<li>into a top-level bullet - Removed stray
<head>/<title>leakage into the converted body - Fixed whitespace handling inside
<pre>blocks and parsing of void elements like<img> - Spreadsheet/CSV table output (which shares the same formatting pipeline) is no longer mangled
[3.0.3] - 2026-07-06
Fixed
- PDF page rendering now delegates to
unpdf's bundledrenderPageAsImage()instead of a manualpdfjs-distpipeline, avoiding version conflicts when a host application bundles a differentpdfjs-distversion (this previously caused scanned PDF OCR to silently return empty results)
Added
canvasadded as a direct dependency for Node.js PDF rendering
[3.0.2] - 2026-07-02
No functional changes — republished to reconcile the direct 3.0.1 hotfix commit with the corresponding pull request (#9) merge.
[3.0.1] - 2026-07-02
Fixed
- OCR VLM API compatibility:
max_tokenstomax_completion_tokensfor OpenAI VLM requests, since newer models (gpt-5.x, o4-mini) rejected the old parameter — fixes OCR support for 12 additional models - PDF rendering: added a Node.js canvas factory required by
pdfjs-distv4 (previously failed withCannot read properties of undefined (reading 'createCanvas')) - Rendering failures are now skipped per-page as expected, while OCR API errors correctly propagate to the caller instead of being silently swallowed
[3.0.0] - 2026-06-26
Added
- OCR support for images and scanned PDFs, with
tesseract.jsbundled as a direct dependency (default provider) - Multi-provider VLM-based OCR:
openai-vlm,anthropic-vlm,ollama-vlm,azure-vision,custom-vlm - New converters: EPUB, URL, and structured data
- Benchmark and test suite (Vitest) covering real-world files across all supported formats
[2.0.1] - 2025-10-09
Changed
- Image metadata extraction now uses the
image-sizepackage
[2.0.0] - 2025-10-09
Major Release - TypeScript Rewrite
This is a major rewrite of the library in TypeScript with improved architecture and documentation.
Added
- TypeScript Support: Complete rewrite in TypeScript with full type definitions
- Modular Architecture: Organized codebase with separate converter modules
src/converters/- Format-specific converters (pdf, docx, html, etc.)src/types/- TypeScript type definitionssrc/utils/- Utility functions
- Type Definitions: Export all types for use in consuming applications
- Examples Directory: Added comprehensive examples in
examples/basic-usage.ts- Common conversion scenariosspreadsheet-conversion.ts- Excel and CSV examplesadvanced-usage.ts- Complex use cases
- Documentation Site: GitHub Pages documentation
- Getting Started guide
- Complete API reference
- Format support guide
- Error handling guide
- GitHub Actions: CI/CD workflows for build and publish
- Contributing Guide: Detailed contribution guidelines
- Migration Guide: v1.x to v2.0 migration documentation
Changed
- Package Structure:
- Source files now in
src/*.tsinstead ofsrc/*.js - Built files in
dist/with proper type declarations - Improved package.json exports for better ESM/CJS compatibility
- Source files now in
- Build Process:
- TypeScript compilation with
tsc - Rollup bundling for optimized output
- Separate ESM and CJS builds
- TypeScript compilation with
- Version Bump: 1.0.1 to 2.0.0 (breaking in terms of package structure)
Improved
- Type Safety: Full TypeScript support with strict type checking
- Developer Experience: Better IDE autocomplete and IntelliSense
- Code Organization: Modular structure makes code easier to maintain
- Documentation: Comprehensive docs with examples
- Error Messages: More descriptive error messages with better context
Maintained
- Backward Compatible API: All existing JavaScript code continues to work
- Same Functionality: All conversion features from v1.x are preserved
- No Breaking Changes: API surface remains identical
[1.0.1] - 2024
Initial Release
- Support for PDF, DOCX, HTML, Excel, CSV, Jupyter, PowerPoint, XML/RSS, Images, Audio
- Basic conversion API with
convertToMarkdown()andsaveToMarkdownFile() - JavaScript implementation with CommonJS and ESM support
Migration Notes
v1.x to v2.0
- No code changes required for basic usage
- TypeScript users get full type definitions
- Package now ships with
dist/instead ofsrc/ - See MIGRATION.md for detailed migration guide
Future Plans
Planned for v2.x
- [ ] Add comprehensive test suite
- [ ] OCR support for image text extraction
- [ ] Speech-to-text for audio transcription
- [ ] Performance optimizations
- [ ] Additional format support
- [ ] CLI tool for command-line usage
- [ ] Batch processing utilities
Under Consideration
- [ ] Plugin system for custom converters
- [ ] Streaming API for large files
- [ ] Progress callbacks
- [ ] Markdown customization options
- [ ] Output format templates
For more information, see:

