{"id":23429870,"url":"https://github.com/mobilusoss/react-anchorify-text","last_synced_at":"2025-04-12T21:35:42.847Z","repository":{"id":33478924,"uuid":"37124638","full_name":"mobilusoss/react-anchorify-text","owner":"mobilusoss","description":"Create anchor tag with urls in text.","archived":false,"fork":false,"pushed_at":"2023-01-03T23:22:07.000Z","size":3226,"stargazers_count":8,"open_issues_count":16,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T13:03:13.146Z","etag":null,"topics":["react","regular-expression"],"latest_commit_sha":null,"homepage":"http://mobilusoss.github.io/react-anchorify-text/","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/mobilusoss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-09T10:03:31.000Z","updated_at":"2021-02-03T23:02:07.000Z","dependencies_parsed_at":"2023-01-15T01:16:31.466Z","dependency_job_id":null,"html_url":"https://github.com/mobilusoss/react-anchorify-text","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-anchorify-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-anchorify-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-anchorify-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-anchorify-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobilusoss","download_url":"https://codeload.github.com/mobilusoss/react-anchorify-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140726,"owners_count":21054341,"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":["react","regular-expression"],"created_at":"2024-12-23T08:13:27.125Z","updated_at":"2025-04-12T21:35:42.824Z","avatar_url":"https://github.com/mobilusoss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-anchorify-text [![Build Status](https://travis-ci.org/mobilusoss/react-anchorify-text.svg?branch=develop)](https://travis-ci.org/mobilusoss/react-anchorify-text) [![npm version](https://badge.fury.io/js/react-anchorify-text.svg)](http://badge.fury.io/js/react-anchorify-text) [![codebeat badge](https://codebeat.co/badges/26eb9d7d-bc90-4351-8a22-ea198e350aff)](https://codebeat.co/projects/github-com-mobilusoss-react-anchorify-text-master) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-anchorify-text.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-anchorify-text?ref=badge_shield) [![codecov](https://codecov.io/gh/mobilusoss/react-anchorify-text/branch/master/graph/badge.svg)](https://codecov.io/gh/mobilusoss/react-anchorify-text)\n\nCreate anchor tag with urls in text.\n\n## Demo\n\n[View Demo](http://mobilusoss.github.io/react-anchorify-text/example/)\n\n## Installation\n\n```bash\nnpm install --save react-anchorify-text\n```\n\n## API\n\n### `AnchorifyText`\n\n#### Props\n\n```javascript\nAnchorifyText.propTypes = {\n  text: React.PropTypes.string.isRequired,\n  linkify: React.PropTypes.object,\n  flags: React.PropTypes.string,\n  nonUrlPartsRenderer: PropTypes.func,\n};\n```\n\n  * `text`: String to parse url\n\n  * `linkify`: An instance of [linkify-it](https://github.com/markdown-it/linkify-it). default: `new LinkifyIt().tlds(require('tlds'))`\n\n  * `target`: href target for anchor tag, default to \"_blank\".\n\n  *  `nonUrlPartsRenderer`: callback for non-url parts of the `text`.\n\n  * ~~`regex`: Regular expression as string to detect url .~~\n\n  * ~~`flags`: Regular expression's frag, default to \"ig\".~~\n\n  `regex` and `flags` props are removed from v2.0.0. Use [linkify-it](https://github.com/markdown-it/linkify-it) instance instead.\n\n#### Children\n\nIf no children are passed to `AnchorifyText`, found urls will be rendered as `\u003ca\u003e` tag.\nIf one child are passed to `AnchorifyText`, found urls are rendered as child tag with `url` as prop.\n\n\n## Usage example\n\n```javascript\n\nconst textWithUrl = \"Hello Google(http://google.com) and GitHub =\u003e https://github.com/ and Apple(www.apple.com)\";\n\n\u003cAnchorifyText text={textWithUrl}\u003e\u003c/AnchorifyText\u003e\n\n\u003cAnchorifyText text={textWithUrl}\u003e\n  \u003cMyCustomAnchor\u003e\u003c/MyCustomAnchor\u003e\n\u003c/AnchorifyText\u003e\n```\n\nSee  [example](https://github.com/mobilusoss/react-anchorify-text/tree/develop/example)\n\n```bash\nyarn\nyarn run start:example\n```\n\n## Tests\n\n```bash\nyarn run test\n```\n\n## Update dependencies\n\nUse [npm-check-updates](https://www.npmjs.com/package/npm-check-updates)\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-anchorify-text.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-anchorify-text?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilusoss%2Freact-anchorify-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobilusoss%2Freact-anchorify-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilusoss%2Freact-anchorify-text/lists"}