Release Notes

v1.2.4

CI / Release pipeline

README / Documentation

v1.2.3

๐ŸŽฏ New Features

Editor Enhancements

Self-Contained Editor Styling

๐ŸŒ Website Redesign

๐Ÿงน Code Quality


v1.2.2

๐Ÿ”ง CI/CD


v1.2.1

๐Ÿ”ง CI/CD


v1.2.0

๐ŸŽฏ New Features

AST Companion Libraries

TypeScript Support

๐Ÿ“ฆ Bundle Sizes


v1.1.1

๐ŸŽฏ New Features

Enhanced Copy-as-Rich-Text

Editor API Enhancements

๐Ÿ› Bug Fixes

Copy-Paste System

MathJax Integration

๐Ÿ“ฆ Bundle Sizes

๐Ÿงน Code Quality

๐Ÿ“š Documentation Updates

v1.1.0

๐Ÿ’ฅ Breaking Changes

Fence Plugin API Redesign

Migration:

// OLD (v1.0.x) - No longer supported
const plugin = (content, lang) => '<pre>' + content + '</pre>';

// NEW (v1.1.0) - Required format
const plugin = {
  render: (content, lang) => '<pre>' + content + '</pre>',
  reverse: (element) => ({ // Optional
    fence: '```',
    lang: 'custom',
    content: element.textContent
  })
};

๐ŸŽฏ New Features

Bidirectional Fence Plugins

Editor Enhancements

๐Ÿ“ฆ Bundle Sizes

๐Ÿ”ฌ Experimental Features

Lexer/Grammar-Based Parser Achievement

๐Ÿ› Bug Fixes

Horizontal Rule Parsing

HTML-to-Markdown Roundtrip Conversion

๐Ÿ”ง QuikdownEditor Improvements

Performance and Responsiveness

Styling Flexibility

๐Ÿงช Testing & Quality Improvements

Comprehensive Test Coverage Boost

Coverage Achievements

Testing Infrastructure

v1.0.5

๐Ÿš€ New: Quikdown Editor

Drop-in Markdown Editor Control

Editor API

Built-in Lazy-Loading Fence Plugins

Editor Examples

Testing & Quality Improvements

๐ŸŽ‰ Major Architecture Refactor

Complete Bidirectional Module Refactoring

๐Ÿ“Š Test Coverage Achievements

๐Ÿ”ง Build System Improvements

๐ŸŽฏ New Features

NPM Discoverability

Lazy Linefeeds Support

``javascript quikdown('Line 1\nLine 2', { lazy_linefeeds: true }); // Output: <p>Line 1<br>Line 2</p> ` ### ๐Ÿ“š Documentation Updates #### API Documentation - Added bidirectional option to core quikdown API reference - Added lazylinefeeds option documentation with examples - Added allowunsafeurls option documentation - Clarified that quikdownbd automatically sets bidirectional: true - Updated TypeScript definitions with new options - Updated examples to reflect new architecture #### Bidirectional Documentation - Explained new bidirectional option in core module - Clarified differences between quikdown and quikdownbd - Updated usage examples ### ๐Ÿ› Bug Fixes #### Table Alignment Fix - **Fixed table alignment in CSS class mode**: Table column alignment (left, center, right) now works correctly in both CSS class and inline styles modes - Previously, alignment only worked with inlinestyles: true option - Now applies alignment as inline style attribute even when using CSS classes - Eliminated duplicate text-align properties in inline styles mode - Example: `markdown | Left | Center | Right | |:-----|:------:|------:| | L | C | R | ` Now correctly renders with proper text alignment in all cells ### ๐Ÿ› ๏ธ Technical Improvements - **Module imports**: Converted all tests from CommonJS to ESM imports - **Dead code elimination**: Removed unreachable code paths identified through coverage analysis - **Logic simplification**: Fixed redundant conditions in strong/em/del element processing - **Istanbul pragmas**: Added appropriate coverage pragmas for defensive code and build artifacts - **Performance**: Maintained same performance characteristics despite architectural changes ### ๐Ÿงน Code Organization - Moved experimental lexer files from src/exp-lexer/ to dev/exp-lexer/ - Kept src/ directory for production code only - Added file size reporting tool (tools/printSizes.cjs) - Updated bidir-fixes.md documentation with completion status - Reorganized examples index page with clear sections for each module - Added individual size badges for all three modules in README ## v1.0.4 ### ๐ŸŽ‰ Major Feature: Bidirectional Conversion Support #### New quikdownbd Module - **HTML to Markdown conversion**: Convert HTML back to Markdown with high fidelity - **Round-trip preservation**: Maintains original markdown formatting through conversion cycles - **Smart source tracking**: Uses data-qd attributes to preserve original markdown syntax - **DOM-based conversion**: Walks the DOM tree for accurate HTML-to-Markdown transformation - **Bundle size**: 12.5KB minified (compared to 8.5KB for core quikdown) #### Bidirectional API - quikdownbd(markdown, options) - Markdown to HTML with source tracking - quikdownbd.toMarkdown(htmlOrElement) - Convert HTML or DOM element back to Markdown - quikdownbd.configure(options) - Create configured bidirectional parser - quikdownbd.version - Version string (synced with core) #### Use Cases - **WYSIWYG Editors**: Build rich-text editors that store content as Markdown - **Live Preview**: Edit in either Markdown or rendered view with real-time sync - **Content Migration**: Convert existing HTML content to Markdown - **Collaborative Editing**: Enable rich-text editing while maintaining Markdown storage ### ๐Ÿ“ฆ Package Improvements #### Module Exports - Added exports field in package.json for clean imports: `javascript import quikdown from 'quikdown'; // Core parser import quikdown_bd from 'quikdown/bd'; // Bidirectional parser ` - Multiple format support: ESM, UMD, CommonJS for both modules - TypeScript definitions for both core and bidirectional modules #### Build System - Integrated quikdownbd into Rollup build pipeline - Generates all format variants (ESM, UMD, CJS, minified) - Source maps for all production builds - Version injection at build time for both modules ### ๐Ÿ“š Documentation #### New Documentation - **Framework Integration Guide** (docs/framework-integration.md) - React (hooks, components, Next.js) - Vue (Composition API, Options API, Nuxt) - Svelte (stores, reactive statements) - Angular (components, services, pipes) - Complete examples with bidirectional support - **Bidirectional Documentation** (docs/quikdown-bidirectional.md) - Comprehensive guide for HTML-to-Markdown conversion - API reference and examples - Limitations and best practices #### Documentation Updates - Updated README with bidirectional module information - Added clear distinction between quikdown and quikdownbd modules - Added module comparison table in API reference - Updated all version references to 1.0.4 ### ๐Ÿงช Testing #### Test Suite Expansion - Added 35 new tests for bidirectional functionality - Integrated jsdom for DOM-based testing in Node.js - Fixed TextEncoder/TextDecoder compatibility for Node.js 18+ - Suppressed punycode deprecation warnings from jsdom - All 144 tests passing (109 core + 35 bidirectional) #### Test Coverage - Core quikdown: 99.58% statement coverage - 100% line coverage maintained - 92.3% branch coverage ### ๐ŸŽจ Examples #### New Examples - **Bidirectional Editor** (examples/quikdown-bd-editor.html) - Full-featured WYSIWYG markdown editor - Real-time bidirectional sync - Mermaid diagram support - Theme toggling - **Bidirectional Basic** (examples/quikdown-bd-basic.html) - Simple demonstration of round-trip conversion - Side-by-side Markdown, HTML, and rendered views - Test suite integration #### Example Updates - All examples now use consistent favicon (favicon.svg) - Updated script paths to use distribution files - Added bidirectional demos to examples index ### ๐Ÿ› Bug Fixes - Fixed mermaid diagram rendering in bidirectional mode - Fixed checkbox state preservation in task lists - Fixed scrolling issues in example editors - Fixed CSS layout for multi-panel editors ### ๐Ÿ”ง Technical Details #### Bidirectional Implementation - Standalone module (doesn't import core quikdown) - Feature parity with core parser - DOM walking algorithm for HTML parsing - Preserves markdown source indicators through data-qd attributes - Handles nested structures and special cases #### Bundle Sizes - quikdown.min.js: 8.5KB (core parser) - quikdownbd.min.js: 12.5KB (bidirectional) - Both maintain zero dependencies ### ๐Ÿš€ Migration Guide #### Upgrading from 1.0.3 - No breaking changes for existing quikdown usage - To add bidirectional support: `javascript // Change from: import quikdown from 'quikdown'; // To: import quikdown_bd from 'quikdown/bd'; // Then use toMarkdown: const markdown = quikdown_bd.toMarkdown(html); ` #### Browser Usage ยงCB1ยง ### ๐Ÿ“ Notes - The toMarkdown() method is only available in quikdown_bd, not in regular quikdown - Bidirectional conversion requires a DOM environment (use jsdom in Node.js) - Round-trip conversion may normalize some markdown formatting - Mermaid diagrams are preserved but not editable in rendered view ## v1.0.3 ### Major Size Optimizations - **Achieved 24% size reduction**: Bundle now ~7.0KB (down from 9.2KB) - Implemented minifier-aware optimizations across dev2-dev4 phases - Module-level constant hoisting (QUIKDOWN_STYLES, CLASS_PREFIX, PLACEHOLDER_CB, ESC_MAP) - Optimized placeholder strings (ยงCBยง vs %%%CODEBLOCK%%%) - CSS string optimization (removed spaces after colons) - Build-time version injection instead of runtime imports - Shorter variable names in critical paths - Eliminated duplicate getAttr functions ### Experimental Lexer Implementation - Developed alternative state-machine based parser (quikdown-lex) - Available as separate build: npm run build:lex - 100% test compatibility with regex implementation - ~7.9KB minified (0.9KB larger than regex version) - 4-8% slower but more maintainable architecture - Better suited for future features like streaming or AST generation - Comprehensive documentation in docs/lexer-implementation.md ### Build System Improvements - Fixed sourcemap warnings in Rollup configuration - Separated lexer build from main distribution - Added performance benchmarking: npm run test:perf - Test coverage now properly tracks dist files (99.56% coverage) ### Developer Experience - Added TypeScript definitions (dist/quikdown.d.ts) - Full type safety for options and return values - Comprehensive JSDoc comments - Compatible with all modern IDEs - Created performance benchmark suite - Compares regex vs lexer implementations - Tests both small (400 char) and large (22KB) documents - Memory usage tracking capabilities ### Code Quality - Eliminated style duplication between main function and emitStyles() - Improved code organization with pattern arrays - Fixed test configuration to measure dist files instead of src - Maintained high test coverage (99.56% statements, 92.12% branches) ### CSS Theme System Improvements - **Container-based theme scoping**: Themes now use parent-child selectors - Light theme: .quikdown-light .quikdown-h1 { ... } - Dark theme: .quikdown-dark .quikdown-h1 { ... } - Allows multiple themes on the same page without conflicts - **Explicit color properties for robustness**: Both themes now specify text colors - Light theme explicitly sets color: #333 for all text elements - Dark theme sets color: #e0e0e0 for light text on dark backgrounds - Prevents inheritance issues when deployed on pages with custom styles - **CSS generation from emitStyles()**: All theme CSS generated directly from JS - npm run build:css generates theme files from emitStyles('quikdown-', 'light/dark') - npm run minify:css creates production-ready minified versions - Single source of truth for styles in JavaScript - **Auto dark mode support**: Dark CSS includes media query for system preferences - .quikdown-auto class automatically applies dark theme when prefers-color-scheme: dark - **Theme file organization**: - dist/quikdown.light.css - Light theme (3.2KB) - dist/quikdown.dark.css - Dark theme with auto mode (4.3KB) - Minified versions: 1.9KB and 2.6KB respectively ### Documentation - Added comprehensive lexer implementation guide - Updated todo.md with current progress - Added experimental feature note to README - Created detailed architecture documentation - CSS theme generation tools in tools/generateThemeCSS.js ## v1.0.2 ### Bug Fixes - Fixed critical ~~~ fence regex bug that was matching fence markers in the middle of text - Now requires fence markers to be at the start of lines - Properly handles text like "## Test with ~~~" without creating empty code blocks ### Improvements - Simplified theme styles for minimal footprint - Updated multi-theme demo with better contrast - Fixed dark mode text visibility issues - Improved light theme code block contrast - Enhanced table header readability in both themes ### Documentation - Removed hardcoded file size references from README - Renamed main demo from live-demo.html to quikdown-live.html - Added quikdown icon/favicon to all example pages - Updated todo.md with current feature set ## v1.0.1 ### Bug Fixes - Fixed README demo URL - Version sync updates across all distribution files ### Improvements - Minor performance optimizations - Test coverage improvements - Documentation updates ### Build - Prepared CI/CD for automated releases ## v1.0.0 ### Initial Release - Core markdown parser with CommonMark subset support - Built-in XSS protection with HTML escaping - URL sanitization for links and images - Support for both ` and ~~~ fence markers - Flexible table parsing (with/without leading pipes) - Task list support with checkboxes - Autolink detection for bare URLs - Fence plugin system for custom code block rendering - Inline styles or CSS class output modes - Zero dependencies - Under 10KB minified - 99%+ test coverage - Works in browser and Node.js environments ### Supported Markdown Features - Headings (H1-H6) with optional trailing #'s - Bold, italic, strikethrough formatting - Inline code and fenced code blocks - Links and images with URL sanitization - Tables with alignment support - Ordered and unordered lists - Nested lists - Task lists with checkboxes - Blockquotes - Horizontal rules - Line breaks (two spaces) - Paragraphs ### Security Features - HTML entity escaping by default - URL sanitization blocking javascript:, vbscript:, data: protocols - Exception for data:image/* for embedded images - External links get rel="noopener noreferrer" - Optional allow_unsafe_urls flag for trusted content ### API - quikdown(markdown, options) - Main parser function - quikdown.emitStyles() - Generate CSS for quikdown classes - quikdown.configure(options) - Create configured parser - quikdown.version` - Version string