{"id":19065473,"url":"https://github.com/menci/markdown-it-merge-cells","last_synced_at":"2025-04-28T11:28:02.181Z","repository":{"id":34308556,"uuid":"177180448","full_name":"Menci/markdown-it-merge-cells","owner":"Menci","description":"A markdown-it plugin to merge adjacent cells with same content in tables","archived":false,"fork":false,"pushed_at":"2023-10-27T00:28:21.000Z","size":207,"stargazers_count":15,"open_issues_count":9,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T19:38:05.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Menci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-22T17:09:03.000Z","updated_at":"2025-02-08T02:15:17.000Z","dependencies_parsed_at":"2024-06-18T18:34:50.633Z","dependency_job_id":"15dfe5ab-fab3-46a4-b66a-9c20c298d339","html_url":"https://github.com/Menci/markdown-it-merge-cells","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"cdecdec446c9fece070a2f392a04aba6bfd6dbed"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Menci%2Fmarkdown-it-merge-cells","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Menci%2Fmarkdown-it-merge-cells/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Menci%2Fmarkdown-it-merge-cells/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Menci%2Fmarkdown-it-merge-cells/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Menci","download_url":"https://codeload.github.com/Menci/markdown-it-merge-cells/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251304018,"owners_count":21567792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T00:50:12.418Z","updated_at":"2025-04-28T11:28:02.156Z","avatar_url":"https://github.com/Menci.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-it-merge-cells\nA markdown-it plugin to merge adjacent cells with same content.\n\nIt will first merge cells with same content in every *column* and then merge cells with same content (and height, if ones are merged in first step) in every *row*. This is by design because usually a column is a field and a row is a record -- it's more reasonable that multi records have same value in a field than in a record multi fields' have same value.\n\n# Usage\n```js\n// Node.js\nlet MarkdownIt = require('markdown-it'),\n    MarkdownItMergeCells = require('markdown-it-merge-cells'),\n    md = new MarkdownIt();\nmd.use(MarkdownItMergeCells);\n\n// Browser (use dist/bundle.min.js)\nlet md = new window.markdownit();\nmd.use(window.markdownitMergeCells);\n\nlet result = md.render(`\n|1|1|3|4|5|\n|-|-|-|-|-|\n|1|1|2|2|6|\n|1|1|2|2|7|\n|1|4|3|5|5|\n`)\n```\n\nThe result is:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003e1\u003c/th\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003cth\u003e5\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=\"3\"\u003e1\u003c/td\u003e\n      \u003ctd rowspan=\"2\"\u003e1\u003c/td\u003e\n      \u003ctd rowspan=\"2\" colspan=\"2\"\u003e2\u003c/td\u003e\n      \u003ctd\u003e6\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e7\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd colspan=\"2\"\u003e5\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nThe rendered HTML is:\n\n```html\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003e1\u003c/th\u003e\n      \u003cth\u003e3\u003c/th\u003e\n      \u003cth\u003e4\u003c/th\u003e\n      \u003cth\u003e5\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=\"3\"\u003e1\u003c/td\u003e\n      \u003ctd rowspan=\"2\"\u003e1\u003c/td\u003e\n      \u003ctd rowspan=\"2\" colspan=\"2\"\u003e2\u003c/td\u003e\n      \u003ctd\u003e6\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e7\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e4\u003c/td\u003e\n      \u003ctd\u003e3\u003c/td\u003e\n      \u003ctd colspan=\"2\"\u003e5\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n```\n\n# Notice\nIt'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.\n\nFile a issue if you find this plugin can't work with latest version of markdown-it.\n\n# License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenci%2Fmarkdown-it-merge-cells","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmenci%2Fmarkdown-it-merge-cells","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenci%2Fmarkdown-it-merge-cells/lists"}