JSPM

micromark-extension-extended-table

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

micromark extension to support table syntax allowing colspan/rowspan

Package Exports

  • micromark-extension-extended-table

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" npm run test-dev