{"id":17436184,"url":"https://github.com/dvhb/phone-highlight","last_synced_at":"2026-03-11T06:31:05.220Z","repository":{"id":35495843,"uuid":"39765451","full_name":"dvhb/phone-highlight","owner":"dvhb","description":"Automatically adds tel: attribute for phone numbers on your HTML page.","archived":false,"fork":false,"pushed_at":"2018-03-31T10:13:39.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":19,"default_branch":"master","last_synced_at":"2026-02-26T08:19:05.285Z","etag":null,"topics":["javascript","mobile-first","phone-number"],"latest_commit_sha":null,"homepage":"http://dvhb.github.io/phone-highlight","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/dvhb.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}},"created_at":"2015-07-27T09:13:32.000Z","updated_at":"2022-10-20T13:19:54.000Z","dependencies_parsed_at":"2022-09-12T06:11:46.025Z","dependency_job_id":null,"html_url":"https://github.com/dvhb/phone-highlight","commit_stats":null,"previous_names":["dvhbru/dvhb-phone-hightlight","dvhbru/phone-highlight"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dvhb/phone-highlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvhb%2Fphone-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvhb%2Fphone-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvhb%2Fphone-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvhb%2Fphone-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvhb","download_url":"https://codeload.github.com/dvhb/phone-highlight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvhb%2Fphone-highlight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"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":["javascript","mobile-first","phone-number"],"created_at":"2024-10-17T10:06:09.943Z","updated_at":"2026-03-11T06:31:04.531Z","avatar_url":"https://github.com/dvhb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery Phone highlight\n\njQuery plugin which helps you replace text phone numbers with `\u003ca href=\"tel:...\"\u003e` tag.\n\nIt may be useful if you want to add user friendly markup on mobile devices, \nbut want to keep text phone numbers in desktop version.\n\nThis plugin don't have library for detecting mobiles devices as a hard dependency.\nYou are free to use your favorite one. For example [mobile-detect.js](https://github.com/hgoebl/mobile-detect.js)\n\nCheck out [demo](http://dvhb.github.io/phone-highlight/) (open from mobile device or use emulation).\n\n### Basic usage\n\nAt first, add `jquery.phone-highlight.js` into your `\u003chead\u003e`.\n\nThen, put following into in you `main.js`:\n\n```javascript\n$('p.containing-phones').phoneHighlight();\n```\n\nOr with mobile-detect.js\n\n```javascript\nvar md = new MobileDetect(window.navigator.userAgent);\nif (md.mobile()) {\n    $('.phones').phoneHighlight();\n}\n```\n\nPlugin will replace text phones with `a` tag. \n\n```HTML\nLorem ipsum dolor \u003ca href=\"tel:+73812786644\" class=\"phone\"\u003e+7 (3812) 78-66-44\u003c/a\u003e\n```\n\n*NOTE!* Do not execute plugin on whole body or other huge/interactive parts of \nthe page! It may break other scripts or cause perfomance issues.\n\n### Configuring\n\nPlugin have 3 options which can be passed into its call:\n\n```javascript\n$('.phone').phoneHighlight({\n\tcountrycode: '+7',\n\tcitycode: '3812',\n\tminLenWithouCodes: 7\n});\n```\n\n### How it works\n\nIt tooks text content of marked nodes and removes all symbols\nexcepting digits and leading plus sign.\n\nThen plugin checks format of obtained result. There are 2 possible cases:\n\n1. Current result already starts with plus sign or its length is greater than \n`minLenWithouCodes` option value. In this case `countrycode` and `citycode`\nwon't be added to phone.\n2. Otherwise phone will be concatinated with `countrycode` and `citycode`\nNote, that default values of `countrycode` and `citycode` options is\nempty strings.\n\nYou can also override global code options by setting \nappropriate `data` attributes:\n\n```HTML\n\u003cspan class=\"phone\" data-countrycode=\"+1\" data-citycode=\"123\"\u003e999-44-22\u003c/span\u003e\n```\n\n### Running tests\n\nAt firts, you have to install dependencies by running `npm install`\nand `bower install`. Now execute `npm run test` command.\n\n### License\n\n[MIT License](./LICENSE) © [dvhb](http://dvhb.ru/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvhb%2Fphone-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvhb%2Fphone-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvhb%2Fphone-highlight/lists"}