{"id":24983702,"url":"https://github.com/posthtml/posthtml-custom-elements","last_synced_at":"2025-04-11T20:52:26.009Z","repository":{"id":1539296,"uuid":"42394346","full_name":"posthtml/posthtml-custom-elements","owner":"posthtml","description":"Custom Elements Plugin","archived":false,"fork":false,"pushed_at":"2023-01-11T11:56:21.000Z","size":96,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T21:06:04.497Z","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/posthtml.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-09-13T12:06:29.000Z","updated_at":"2023-08-18T13:29:46.000Z","dependencies_parsed_at":"2023-01-13T11:12:43.027Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-custom-elements","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-custom-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-custom-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-custom-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-custom-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-custom-elements/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299829,"owners_count":20916190,"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":"2025-02-04T09:20:33.432Z","updated_at":"2025-04-11T20:52:25.987Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"[![NPM][npm]][npm-url]\n[![Deps][deps]][deps-url]\n[![Tests][travis]][travis-url]\n[![Coverage][cover]][cover-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"220\" height=\"150\" title=\"PostHTML\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n  \u003ch1\u003eCustom Elements Plugin\u003c/h1\u003e\n  \u003cp\u003eUse custom elements now!\u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm i -D posthtml-custom-elements\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n```js\nconst posthtml = require('posthtml')\n\nconst custom = require('posthtml-custom-elements')\n\nconst component = `\u003cmy-component\u003e\n                    \u003ctext-h1 class=\"text\"\u003eText\u003c/text-h1\u003e\n                    \u003cul\u003e\n                      \u003ccustome tag=\"li\"\u003elist\u003c/custome\u003e\n                    \u003c/ul\u003e\n                  \u003c/my-component\u003e`\n\nposthtml([ custom({ defaultTag: 'span' }) ])\n    .process(component)\n    .then((result) =\u003e console.log(result.html))\n```\n\n```html\n\u003cspan class=\"my-component\"\u003e\n  \u003cspan class=\"text-h1 text\"\u003eText\u003c/span\u003e\n  \u003cul\u003e\n    \u003cli\u003elist\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/span\u003e\n```\n\n## Options\n\n#### `defaultTag`\n\n__Default__: `div`\n\nTag is used to replace the custom tag\n\n*Options* `{ defaultTag: 'span' }`\n\n```html\n\u003ccustom\u003eTest\u003c/custom\u003e\n```\n\n```html\n\u003cspan class=\"custom\"\u003eTest\u003c/span\u003e\n```\n\n#### `skipTags`\n\n__Default__: `[]`\n\nSkip HTML5 tag\n\n*Options* `{ skipTags: ['header'] }`\n\n```html\n\u003cheader\u003eTest\u003c/header\u003e\n```\n\n```html\n\u003cheader\u003eTest\u003c/header\u003e\n```\n\n## Support\n\n#### `attribute tag`\n\n```html\n\u003ccustome tag=\"pre\"\u003eTest\u003c/custome\u003e\n```\n\n```html\n\u003cpre\u003eTest\u003c/pre\u003e\n```\n\n\u003ch2 align=\"center\"\u003eLICENSE\u003c/h2\u003e\n\n\u003e MIT License (MIT)\n\n\u003e Copyright (c) 2016 PostHTML Ivan Voischev\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\n\u003e The above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[npm]: https://img.shields.io/npm/v/posthtml-custom-elements.svg\n[npm-url]: https://npmjs.com/package/posthtml-custom-elements\n\n[deps]: https://david-dm.org/posthtml/posthtml-custom-elements.svg\n[deps-url]: https://david-dm.org/posthtml/posthtml-custom-elements\n\n[travis]: http://img.shields.io/travis/posthtml/posthtml-custom-elements/master.svg\n[travis-url]: https://travis-ci.org/posthtml/posthtml-custom-elements\n\n[cover]: https://coveralls.io/repos/github/posthtml/posthtml-custom-elements/badge.svg?branch=master\n[cover-url]: https://coveralls.io/github/posthtml/posthtml-custom-elements?branch=master\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-custom-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-custom-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-custom-elements/lists"}