npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

markdown-it-merge-cells-plus

v1.0.1

Published

A markdown-it plugin to merge table cells on demand with explicit markers ("<" / "^")

Downloads

293

Readme

markdown-it-merge-cells-plus

A markdown-it plugin to merge table cells on demand with explicit markers.

By default cells are not merged. Put < or ^ in a cell to merge it manually:

  • < — merge this cell into the cell on its left (horizontal / colspan)
  • ^ — merge this cell into the cell above (vertical / rowspan)

This follows the convention used by MultiMarkdown / PHP Markdown Extra table extensions.

The header row may only merge left/right with <; it can never be merged up/down. Consequently ^ only takes effect from the second body row (row 2) on — the first body row sits right under the header and must not fold into it.

Install

npm install markdown-it-merge-cells-plus

Usage

// Node.js
let MarkdownIt = require('markdown-it'),
    MarkdownItMergeCells = require('markdown-it-merge-cells-plus'),
    md = new MarkdownIt();
md.use(MarkdownItMergeCells);

// Browser: bundle it with your bundler of choice (webpack, Rollup, esbuild, ...),
// or load markdown-it and this plugin as ES modules from a CDN:
import markdownit from 'https://cdn.jsdelivr.net/npm/markdown-it/+esm';
import mergeCells from 'https://cdn.jsdelivr.net/npm/markdown-it-merge-cells-plus/+esm';
const md = markdownit().use(mergeCells);

let result = md.render(`
| Region | <   | Q1   |
|--------|-----|------|
| North  | <   | 100  |
| ^      | <   | 200  |
| South  | <   | 300  |
`)

The result is:

<table>
  <thead>
    <tr>
      <th colspan="2">Region</th>
      <th>Q1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="2" colspan="2">North</td>
      <td>100</td>
    </tr>
    <tr>
      <td>200</td>
    </tr>
    <tr>
      <td colspan="2">South</td>
      <td>300</td>
    </tr>
  </tbody>
</table>

Rendered:

Rules

  • A cell whose trimmed content is exactly < (not in the first column) merges into the cell on its left.
  • A cell whose trimmed content is exactly ^ (from row 2 on) merges into the cell above.
  • Any other content is left alone — identical neighbours are not merged.
  • < in the first column and ^ in the header / first body row are no-ops: they render as literal < / ^ text rather than triggering a merge.
  • Markers chain naturally, so a </^ region must form a rectangle (HTML tables cannot represent irregular shapes).

Notice

It's done by wrap markdown-it's table parser and modify the generated tokens (which will be rendered to HTML). If in later versions markdown-it change the tokens' generated by table parser, this plugin may not able to work anymore.

File an issue if you find this plugin can't work with the latest version of markdown-it.

Test

node test/test.js      # runs assertions and writes test/output.html

test/output.html shows every case as markdown source beside its rendered table for a side-by-side comparison.

License

MIT

Acknowledgements

This plugin is a fork of markdown-it-merge-cells by Menci, published under the MIT License. The merge behaviour was changed from "auto-merge identical neighbours" to explicit < / ^ markers (MultiMarkdown / PHP Markdown Extra convention).