{"id":35012773,"url":"https://github.com/fefit/rphtml","last_synced_at":"2025-12-27T05:04:22.552Z","repository":{"id":57663199,"uuid":"293234564","full_name":"fefit/rphtml","owner":"fefit","description":"A html parser written in RUST, parse html into node trees.","archived":false,"fork":false,"pushed_at":"2025-03-19T13:05:42.000Z","size":5065,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-24T22:15:38.311Z","etag":null,"topics":["html-minify","html-parser","html-parsing"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/fefit.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}},"created_at":"2020-09-06T08:28:27.000Z","updated_at":"2025-05-22T10:44:40.000Z","dependencies_parsed_at":"2024-04-17T13:32:57.999Z","dependency_job_id":"b5907b00-e998-48f4-bad4-1b3cb8e4226e","html_url":"https://github.com/fefit/rphtml","commit_stats":{"total_commits":129,"total_committers":2,"mean_commits":64.5,"dds":"0.43410852713178294","last_synced_commit":"30bad79b8ed8a330235af233a49b226fac62be2a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/fefit/rphtml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefit%2Frphtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefit%2Frphtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefit%2Frphtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefit%2Frphtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fefit","download_url":"https://codeload.github.com/fefit/rphtml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fefit%2Frphtml/sbom","scorecard":{"id":395712,"data":{"date":"2025-08-11","repo":{"name":"github.com/fefit/rphtml","commit":"d6bb95ba8809837e3f6a7ec79d2c4e4927481fae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/fefit/rphtml/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/fefit/rphtml/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/fefit/rphtml/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/fefit/rphtml/test.yml/master?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/test.yml:47","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun 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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-18T18:57:13.672Z","repository_id":57663199,"created_at":"2025-08-18T18:57:13.672Z","updated_at":"2025-08-18T18:57:13.672Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072690,"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-12-27T02:00:05.897Z","response_time":58,"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":["html-minify","html-parser","html-parsing"],"created_at":"2025-12-27T05:02:39.961Z","updated_at":"2025-12-27T05:04:22.547Z","avatar_url":"https://github.com/fefit.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rphtml\n\n一个用 rust 编写的 html 文档解析器，0.4.0 版本前通过 wasm-pack/wasm-bindgen 提供 npm 包。\n\n[![npm version](https://badge.fury.io/js/rphtml.svg)](https://badge.fury.io/js/rphtml)\n[![Build Status](https://github.com/fefit/rphtml/actions/workflows/test.yml/badge.svg)](https://github.com/fefit/rphtml/actions)\n[![codecov](https://codecov.io/gh/fefit/rphtml/branch/master/graph/badge.svg)](https://codecov.io/gh/fefit/rphtml)\n\n## 如何使用\n\n```rust\nuse rphtml::parser::{ Doc, ParseOptions, RenderOptions, HResult };\nfn main()-\u003eHResult{\n  let doc = Doc::parse(\"\u003cdiv id='content'\u003erpthml\u003c/div\u003e\", ParseOptions{\n    case_sensitive_tagname: false, // 解析时标签区分大小写，`\u003cdiv\u003e` 和 `\u003cDIV\u003e` 将被视作不同标签，不建议开启\n    allow_self_closing: false, // 允许非替换元素使用自闭合的写法，如 `\u003cdiv class='' /\u003e`\n    auto_fix_unclosed_tag: true, // 自动修复没有结束的标签，注意这里只是简单的将标签闭合\n    auto_fix_unexpected_endtag: true, // 自动修复不正确的结束标签，如 \"\u003cdiv\u003e\u003c/p\u003e\u003c/div\u003e\" 会被修复为 \"\u003cdiv\u003e\u003c/div\u003e\"\n    auto_fix_unescaped_lt: true, // 自动修复没有实体转译的左尖括号 '\u003c', 比如`\u003cdiv\u003ea\u003cb\u003c/div\u003e`会被修复为`\u003cdiv\u003ea\u0026lt;b\u003c/div\u003e`\n    allow_attr_key_starts_with_equal_sign: true, // 是否允许 \"=\" 符号出现在属性名的开头，如 `\u003cdiv =a=\"c\" /\u003e` 属性名为\"=a\"，值为\"c\"\n  })?;\n  // 获取root根节点\n  let root = doc.get_root_node();\n  let render_html = doc.render(\u0026RenderOptions{\n    ..Default::default() // RenderOptions的参数定义可以在wiki中查看\n  });\n}\n```\n\n## License\n\n[MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffefit%2Frphtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffefit%2Frphtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffefit%2Frphtml/lists"}