{"repo":"renbaoshuo/rehype-merge-cells","free":true,"listed":false,"github":"https://github.com/renbaoshuo/rehype-merge-cells","clone":"git clone https://github.com/renbaoshuo/rehype-merge-cells.git","description":"A rehype plugin to merge adjacent table cells with same content.","language":"JavaScript","stars":11,"topics":["markdown","md","rehype","rehype-plugin","table","unified"],"license":null,"category":"productivity","readme_excerpt":"rehype-merge-cells A rehype plugin that merges adjacent table cells with identical content. It operates on HAST nodes in a unified / rehype pipeline. It works with standard GFM Markdown tables and needs no custom table syntax or markers. Vertically adjacent cells are merged using rowspan , horizontally adjacent cells using colspan . This package implements the same merging algorithm as markdown-it-merge-cells . Features - Supports standard GFM Markdown tables. - No custom table syntax or marker is required. - Merges vertically adjacent cells with the same content using rowspan . - Merges horizontally adjacent cells with the same content using colspan . - Runs vertical merging before horizontal merging. - Prevents invalid horizontal merges by requiring the matched cells to share the same rowspan height. - Never merges header cells with body cells. - Recognizes matching inline structures such as emphasis and links. Install Usage Output: 1 3 4 5 1 1 2 6 7 4 3 5 API rehypeMergeCells() Returns a rehype transformer that visits every table element and merges its cells in place. The plugin is available as both a default and a named export: Merging rules Given a table matrix, the plugin applies two passes, in order: 1. Vertical pass — cells in the same column with identical content are merged upward and assigned rowspan . 2. Horizontal pass — cells in the same row with identical content are merged leftward and assigned colspan . The horizontal pass only proceeds when the candidate cel","default_branch":null,"files":null,"tree":[],"storefront":"/r/renbaoshuo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/renbaoshuo/rehype-merge-cells/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}