{"library":"micromark-util-combine-extensions","title":"micromark Extension Combiner Utility","description":"micromark-util-combine-extensions is a dedicated utility package within the unified collective, designed to efficiently merge multiple micromark syntax extensions or HTML extensions into a single, cohesive extension object. This functionality is crucial for creating and managing markdown processing presets, such as `micromark-extension-gfm`, which bundle several individual extensions into a convenient package. The package is currently at version 2.0.1, which is compatible with Node.js 16+ and works specifically with `micromark@3`. As a component of the `micromark` monorepo, its release cadence generally aligns with the broader `micromark` project, which sees regular updates for performance and bug fixes across its various components. Its primary differentiator is its singular focus on extension combination, providing a streamlined API (`combineExtensions`, `combineHtmlExtensions`) that simplifies complex extension management for developers building custom markdown processing pipelines.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install micromark-util-combine-extensions"],"cli":null},"imports":["import { combineExtensions } from 'micromark-util-combine-extensions'","import { combineHtmlExtensions } from 'micromark-util-combine-extensions'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import {gfmAutolinkLiteral} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable} from 'micromark-extension-gfm-table'\nimport {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item'\nimport {combineExtensions} from 'micromark-util-combine-extensions'\n\n// This example combines several GFM syntax extensions into a single extension object\n// suitable for use with micromark. Note that some extensions are functions that need\n// to be called (e.g., gfmStrikethrough()), while others are direct objects.\nconst combinedGfmSyntaxExtension = combineExtensions([\n  gfmAutolinkLiteral,\n  gfmStrikethrough(), // Some extensions are functions that return the actual extension object\n  gfmTable,\n  gfmTaskListItem\n])\n\nconsole.log('Successfully combined GFM syntax extensions for micromark:', combinedGfmSyntaxExtension)\n\n// You would typically pass this combined extension to the micromark parser:\n// import { micromark } from 'micromark';\n// const html = micromark('~Hello~', { extensions: [combinedGfmSyntaxExtension] });\n// console.log(html); // Outputs HTML for strikethrough content, e.g., <p><del>Hello</del></p>","lang":"javascript","description":"Demonstrates how to combine multiple individual micromark syntax extensions into a single extension object using `combineExtensions` for easier management and use with the `micromark` parser.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}