{"id":24983666,"url":"https://github.com/posthtml/posthtml-render","last_synced_at":"2025-12-12T04:02:22.033Z","repository":{"id":1764111,"uuid":"44296777","full_name":"posthtml/posthtml-render","owner":"posthtml","description":"Render PostHTMLTree to HTML/XML","archived":false,"fork":false,"pushed_at":"2024-06-19T10:51:11.000Z","size":1310,"stargazers_count":45,"open_issues_count":10,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-23T19:27:00.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posthtml.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"posthtml","open_collective":"posthtml","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-10-15T05:58:22.000Z","updated_at":"2024-10-15T20:09:19.000Z","dependencies_parsed_at":"2024-11-05T22:03:25.670Z","dependency_job_id":"8f0a5081-ffb1-46af-a681-9b37ce7cc5be","html_url":"https://github.com/posthtml/posthtml-render","commit_stats":{"total_commits":162,"total_committers":19,"mean_commits":8.526315789473685,"dds":"0.45679012345679015","last_synced_commit":"47e750b67c27cb1f5b74bb38e419a31d97c7af6a"},"previous_names":["voischev/posthtml-render"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/posthtml/posthtml-render","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-render","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-render/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-render/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-render/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-render/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-render/sbom","scorecard":{"id":741848,"data":{"date":"2025-08-11","repo":{"name":"github.com/posthtml/posthtml-render","commit":"47e750b67c27cb1f5b74bb38e419a31d97c7af6a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/posthtml/posthtml-render/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/posthtml/posthtml-render/nodejs.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/posthtml/posthtml-render/nodejs.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: license:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"30 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-3mv9-4h5g-vhg3","Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T17:38:50.040Z","repository_id":1764111,"created_at":"2025-08-22T17:38:50.040Z","updated_at":"2025-08-22T17:38:50.040Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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","status":"online","status_checked_at":"2025-11-26T02:00:06.075Z","response_time":193,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-02-04T09:20:16.112Z","updated_at":"2025-12-12T04:02:21.977Z","avatar_url":"https://github.com/posthtml.png","language":"TypeScript","readme":"[![npm][npm]][npm-url]\n[![node]]()\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/posthtml/posthtml\"\u003e\n    \u003cimg width=\"200\" height=\"200\" alt=\"PostHTML\"\n      src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003ePostHTML Render\u003c/h1\u003e\n  \u003cp\u003eRenders a PostHTML Tree to HTML/XML\u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm i -D posthtml-render\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n### `NodeJS`\n\n```js\nimport { render } from 'posthtml-render';\n\nconst tree = [];\n\nconst node = {};\n\nnode.tag = 'ul';\nnode.attrs = { class: 'list' };\nnode.content = [\n 'one',\n 'two',\n 'three'\n].map((content) =\u003e ({ tag: 'li', content }));\n\ntree.push(node);\n\nconst html = render(tree, options);\n\n```\n\n```html\n\u003cul class=\"list\"\u003e\n  \u003cli\u003eone\u003c/li\u003e\n  \u003cli\u003etwo\u003c/li\u003e\n  \u003cli\u003ethree\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n\u003ch2 align=\"center\"\u003eOptions\u003c/h2\u003e\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|**[`singleTags`](#singletags)**|`{Array\u003cString\\|RegExp\u003e}`|`[]`|Specify custom single tags (self closing)|\n|**[`closingSingleTag`](#closingSingleTag)**|`{String}`|[`\u003e`](#default)|Specify the single tag closing format|\n|**[`quoteAllAttributes`](#quoteAllAttributes)**|`{Boolean}`|[`true`](#default)|Put double quotes around all tags, even when not necessary.|\n|**[`replaceQuote`](#replaceQuote)**|`{Boolean}`|[`true`](#default)|Replaces quotes in attribute values with `\u0026quote;`.|\n|**[`quoteStyle`](#quoteStyle)**|`{0 or 1 or 2}`|[`2`](#default)|Specify the style of quote arround the attribute values|\n\n### `singleTags`\n\nSpecify custom single tags (self closing)\n\n### `{String}`\n\n```js\nconst render = require('posthtml-render')\n\nconst tree = [ { tag: 'name' } ]\nconst options = { singleTags: [ 'name' ] }\n\nconst html = render(tree, options)\n```\n\n**result.html**\n```html\n\u003cname\u003e\n```\n\n#### `{RegExp}`\n\n```js\nconst render = require('posthtml-render')\n\nconst tree = [ { tag: '%=title%' } ]\nconst options = { singleTags: [ /^%.*%$/ ] }\n\nconst html = render(tree, options)\n```\n\n**result.html**\n```html\n\u003c%=title%\u003e\n```\n\n### `closingSingleTag`\n\nSpecify the single tag closing format\n\n#### `Formats`\n\n```js\nconst render = require('posthtml-render')\n\nconst tree = [ { tag: 'img' } ]\n```\n\n##### `'tag'`\n\n```js\nconst html = render(tree, { closingSingleTag: 'tag' })\n```\n\n```html\n\u003ccustom\u003e\u003c/custom\u003e\n```\n\n##### `'slash'`\n\n```js\nconst html = render(tree, { closingSingleTag: 'slash' })\n```\n\n```html\n\u003ccustom /\u003e\n```\n\n##### `'default' (Default)`\n\n```js\nconst html = render(tree)\n```\n\n```html\n\u003cimg\u003e\n```\n\n##### `'closeAs'`\n\n```js\nconst tree = [ {\n  tag: 'custom',\n  closeAs: 'default' // Available types: `tag` | `slash` | `default`\n} ]\nconst html = render(tree, { closingSingleTag: 'closeAs' })\n```\n\n```html\n\u003ccustom\u003e\n```\n\n### `quoteAllAttributes`\n\nSpecify if all attributes should be quoted.\n\n##### `true (Default)`\n\n```html\n\u003ci src=\"index.js\"\u003e\u003c/i\u003e\n```\n\n##### `false`\n\n```html\n\u003ci src=index.js\u003e\u003c/i\u003e\n```\n\n### `replaceQuote`\n\nReplaces quotes in attribute values with `\u0026quote;`.\n\n##### `true (Default)`\n\n```html\n\u003cimg src=\"\u003c?php echo $foo[\u0026quote;bar\u0026quote;] ?\u003e\"\u003e\n```\n\n##### `false`\n\n```html\n\u003cimg src=\"\u003c?php echo $foo[\"bar\"] ?\u003e\"\u003e\n```\n\n### `quoteStyle`\n\n##### `2 (Default)`\n\nAttribute values are wrapped in double quotes:\n\n```html\n\u003cimg src=\"https://example.com/example.png\" onload=\"testFunc(\"test\")\"\u003e\n```\n\n##### `1`\n\nAttribute values are wrapped in single quote:\n\n```html\n\u003cimg src='https://example.com/example.png' onload='testFunc(\"test\")'\u003e\n```\n\n##### `0`\n\nQuote style is based on attribute values (an alternative for `replaceQuote` option):\n\n```html\n\u003cimg src=\"https://example.com/example.png\" onload='testFunc(\"test\")'\u003e\n```\n\n\n[npm]: https://img.shields.io/npm/v/posthtml-render.svg\n[npm-url]: https://npmjs.com/package/posthtml-render\n\n[node]: https://img.shields.io/node/v/posthtml-render.svg\n[node-url]: https://img.shields.io/node/v/posthtml-render.svg\n\n[tests]: http://img.shields.io/travis/posthtml/posthtml-render.svg\n[tests-url]: https://travis-ci.org/posthtml/posthtml-render\n\n[cover]: https://coveralls.io/repos/github/posthtml/posthtml-render/badge.svg\n[cover-url]: https://coveralls.io/github/posthtml/posthtml-render\n","funding_links":["https://patreon.com/posthtml","https://opencollective.com/posthtml"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-render","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-render","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-render/lists"}