{"id":28573673,"url":"https://github.com/remarkjs/remark-squeeze-paragraphs","last_synced_at":"2025-06-10T21:19:24.027Z","repository":{"id":46338412,"uuid":"49022812","full_name":"remarkjs/remark-squeeze-paragraphs","owner":"remarkjs","description":"plugin to remove empty (or white-space only) paragraphs","archived":false,"fork":false,"pushed_at":"2023-09-20T11:29:54.000Z","size":86,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-25T17:46:00.422Z","etag":null,"topics":["paragraph","remark","remark-plugin","remove"],"latest_commit_sha":null,"homepage":"https://remark.js.org","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/remarkjs.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},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2016-01-04T20:59:49.000Z","updated_at":"2023-12-13T06:13:54.000Z","dependencies_parsed_at":"2024-06-18T17:00:13.217Z","dependency_job_id":null,"html_url":"https://github.com/remarkjs/remark-squeeze-paragraphs","commit_stats":{"total_commits":90,"total_committers":2,"mean_commits":45.0,"dds":"0.16666666666666663","last_synced_commit":"239f4eec7e60a5e3f21cf719128c5c2a5a4326fe"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-squeeze-paragraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-squeeze-paragraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-squeeze-paragraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-squeeze-paragraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-squeeze-paragraphs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-squeeze-paragraphs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":257487934,"owners_count":22552904,"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":["paragraph","remark","remark-plugin","remove"],"created_at":"2025-06-10T21:18:59.372Z","updated_at":"2025-06-10T21:19:23.847Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# remark-squeeze-paragraphs\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to remove empty (or white space only) paragraphs.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`unified().use(remarkSqueezeParagraphs)`](#unifieduseremarksqueezeparagraphs)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin that removes empty paragraphs,\nleft over from other operations, from the tree.\nParagraphs are considered empty if they do not contain non-whitespace\ncharacters.\n\n## When should I use this?\n\nThis project is mostly useful when you’re using other plugins that remove things\nfrom the AST (such as [`remark-strip-badges`][remark-strip-badges]).\nYou can then use this plugin afterwards to clean stray empty paragraphs.\n\n\u003e 👉 **Note**: this plugin used to be useful, but with time the responsibility\n\u003e for cleaning the tree has shifted to the plugins that cause that.\n\u003e\n\u003e If you need this, you should also open an issue with the tools causing that.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-squeeze-paragraphs\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkSqueezeParagraphs from 'https://esm.sh/remark-squeeze-paragraphs@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkSqueezeParagraphs from 'https://esm.sh/remark-squeeze-paragraphs@6?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {remark} from 'remark'\nimport remarkSqueezeParagraphs from 'remark-squeeze-paragraphs'\nimport remarkStripBadges from 'remark-strip-badges'\n\nconsole.log(\n  String(\n    await remark()\n      .use(remarkStripBadges)\n      .process('![](https://img.shields.io/)\\n\\ntext')\n  )\n)\n// =\u003e '\\n\\ntext\\n'\n\nconsole.log(\n  String(\n    await remark()\n      .use(remarkStripBadges)\n      .use(remarkSqueezeParagraphs)\n      .process('![](https://img.shields.io/)\\n\\ntext')\n  )\n)\n// =\u003e 'text\\n'\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is\n[`remarkSqueezeParagraphs`][api-remark-squeeze-paragraphs].\n\n### `unified().use(remarkSqueezeParagraphs)`\n\nRemove empty (or white space only) paragraphs.\n\n###### Parameters\n\nThere are no parameters.\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`remark-squeeze-paragraphs@^6`, compatible with Node.js 16.\n\nThis plugin works with `unified` version 3+ and `remark` version 4+.\n\n## Security\n\nUse of `remark-squeeze-paragraphs` does not involve **[rehype][]**\n(**[hast][]**) or user content so there are no openings for [cross-site\nscripting (XSS)][wiki-xss] attacks.\n\n## Related\n\n*   [`mdast-squeeze-paragraphs`][mdast-squeeze-paragraphs]\n    — mdast utility with similar functionality\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © Eugene Sharygin\n\n[build-badge]: https://github.com/remarkjs/remark-squeeze-paragraphs/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-squeeze-paragraphs/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-squeeze-paragraphs.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-squeeze-paragraphs\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-squeeze-paragraphs.svg\n\n[downloads]: https://www.npmjs.com/package/remark-squeeze-paragraphs\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-squeeze-paragraphs\n\n[size]: https://bundlejs.com/?q=remark-squeeze-paragraphs\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[remark]: https://github.com/remarkjs/remark\n\n[hast]: https://github.com/syntax-tree/hast\n\n[mdast-squeeze-paragraphs]: https://github.com/syntax-tree/mdast-squeeze-paragraphs\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark-strip-badges]: https://github.com/remarkjs/remark-strip-badges\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[typescript]: https://www.typescriptlang.org\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-remark-squeeze-paragraphs]: #unifieduseremarksqueezeparagraphs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-squeeze-paragraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-squeeze-paragraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-squeeze-paragraphs/lists"}