JSPM

micromark-extension-extended-table

2.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3599
  • Score
    100M100P100Q136069F
  • License MIT

micromark extension to support table syntax allowing colspan/rowspan

Package Exports

  • micromark-extension-extended-table
  • micromark-extension-extended-table/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (micromark-extension-extended-table) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

micromark-extension-extended-table

micromark extension to parse table syntax allowing colspan / rowspan

Important

If you want to generate HTML table with colspan / rowspan from markdown source, please use mdast-util-extended-table or remark-extended-table which internally uses this extension.

This parses extended table syntax and generates some events. Those events are processed by mdast-util-extended-table into mdast and hast. Only this package doesn't generate HTML table with colspan / rowspan.

Install

$ npm install micromark-extension-extended-table

Use

Set this in micromark extensions option with micromark-extension-gfm-table.

import { micromark } from 'micromark';
import { gfmTable, gfmTableHtml } from 'micromark-extension-gfm-table';
import { extendedTable, extendedTableHtml } from 'micromark-extension-extended-table';

const md = `
| a | b |
|---|---|
| ^ | 1 |
`;

const result = micromark(md, {
  extensions: [gfmTable(), extendedTable],
  htmlExtensions: [gfmTableHtml(), extendedTableHtml],
});

Test in development

For development purpose, you can run tests with debug messages.

$ DEBUG="micromark-extension-extended-table:syntax" pnpm run test