{"id":29138606,"url":"https://github.com/nextcloud-libraries/remark-unlink-protocols","last_synced_at":"2026-01-20T18:01:08.989Z","repository":{"id":294194912,"uuid":"986162365","full_name":"nextcloud-libraries/remark-unlink-protocols","owner":"nextcloud-libraries","description":"Remark plugin to remove links and references based on their protocol","archived":false,"fork":false,"pushed_at":"2025-11-17T20:57:15.000Z","size":348,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-17T22:22:48.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nextcloud-libraries.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-19T07:49:08.000Z","updated_at":"2025-11-17T20:57:17.000Z","dependencies_parsed_at":"2025-05-26T08:19:08.420Z","dependency_job_id":null,"html_url":"https://github.com/nextcloud-libraries/remark-unlink-protocols","commit_stats":null,"previous_names":["nextcloud-libraries/remark-unlink-protocol","nextcloud-libraries/remark-unlink-protocols"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nextcloud-libraries/remark-unlink-protocols","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fremark-unlink-protocols","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fremark-unlink-protocols/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fremark-unlink-protocols/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fremark-unlink-protocols/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/remark-unlink-protocols/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fremark-unlink-protocols/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-06-30T14:10:24.232Z","updated_at":"2026-01-20T18:01:08.958Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":"JavaScript","readme":"\u003c!--\n  - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: MIT\n--\u003e\n\n# remark-unlink-protocols\n\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/remark-unlink-protocol)](https://api.reuse.software/info/github.com/nextcloud-libraries/remark-unlink-protocol)\n\n**[remark][]** plugin to turn links into plain text based on their protocols.\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* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin to remove all links\nthat use other protocols than the ones specified\n(`http` and `https` by default).\n\n## When should I use this?\n\nThis project is useful if you want to limit the protocols\nthat can be linked to when processing markdown.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-unlink-protocols\n```\n\n## Use\n\nSay we have the following file `example.md` and apply `remark-unlink-protocols`\nwith the default protocols (`http` and `https`).\n\n```markdown\n# Uranus\n\n**Uranus** is the seventh [planet](/wiki/Planet 'Planet') from the Sun and is a\ngaseous cyan [ice giant](/wiki/Ice_giant 'Ice giant').\n\nPhotograph of Uranus in true colour by Voyager 2 in 1986:\n\n![This is an image of the planet Uranus taken by the spacecraft Voyager 2 in 1986.\nThe Voyager project is managed for NASA by the Jet Propulsion Laboratory.](\u003chttps://en.wikipedia.org/wiki/Uranus#/media/File:Uranus_as_seen_by_NASA's_Voyager_2_(remastered)_-_JPEG_converted.jpg\u003e)\n\nSend comments to [me](mailto:test@domain.example)\n```\n\n…and a module `example.js`:\n\n```js\nimport {remark} from 'remark'\nimport remarkUnlinkProtocols from 'remark-unlink-protocols'\nimport {read} from 'to-vfile'\n\nconst file = await remark()\n  .use(remarkUnlinkProtocols, { except: 'mailto' })\n  .process(await read('example.md'))\n\nconsole.log(String(file))\n```\n\n…then running `node example.js` yields:\n\n```markdown\n# Uranus\n\n**Uranus** is the seventh planet from the Sun and is a\ngaseous cyan ice giant.\n\nPhotograph of Uranus in true colour by Voyager 2 in 1986:\n\n![This is an image of the planet Uranus taken by the spacecraft Voyager 2 in 1986.\nThe Voyager project is managed for NASA by the Jet Propulsion Laboratory.](\u003chttps://en.wikipedia.org/wiki/Uranus#/media/File:Uranus_as_seen_by_NASA's_Voyager_2_(remastered)_-_JPEG_converted.jpg\u003e)\n\nThe Voyager project is managed for NASA by the Jet Propulsion\nLaboratory.\n\nSend comments to [me](mailto:test@domain.example).\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is `remarkUnlinkProtocols`.\n\n#### `unified().use(remarkUnlinkProtocols)`\n\nRemove all links and references that do not use the `http` or `https` protocols.\n\n###### Parameters\n\n`except`: `string[]` - protocols to keep - `['http', 'https']` by default.\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\nThe current release, `remark-unlink-protocols@^1` is compatible with Node.js 22.\n\nThis plugin works with `unified` version 3+ and `remark` version 4+.\n\n## Security\n\nUse of `remark-unlink-protocols` does not involve\n**[rehype][]** (**[hast][]**) or user content\nso there are no openings for [cross-site scripting (XSS)][wiki-xss]\nattacks.\n\n## Contribute\n\n[Nextcloud][nc-coc] and [Remarkjs][coc] have a code of conduct.\nBy interacting with the respective repositories, organization, or community\nyou agree to abide by its terms.\n\n## License\n\n[MIT][license] © 2025 Nextcloud GmbH and Nextcloud contributors\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[hast]: https://github.com/syntax-tree/hast\n\n[license]: LICENSE\n\n[nc-coc]: https://nextcloud.com/contribute/code-of-conduct/\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark]: https://github.com/remarkjs/remark\n\n[typescript]: https://www.typescriptlang.org\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fremark-unlink-protocols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Fremark-unlink-protocols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fremark-unlink-protocols/lists"}