{"id":38584110,"url":"https://github.com/darkoatanasovski/htmltags","last_synced_at":"2026-01-17T08:17:51.330Z","repository":{"id":57493013,"uuid":"142614079","full_name":"darkoatanasovski/htmltags","owner":"darkoatanasovski","description":"A useful GoLang package for strip HTML tags from a string","archived":false,"fork":false,"pushed_at":"2018-09-24T08:24:28.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T17:49:54.172Z","etag":null,"topics":["crawler","go","golang","html","package","strip","tags","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darkoatanasovski.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":"2018-07-27T19:02:51.000Z","updated_at":"2024-06-19T17:49:54.172Z","dependencies_parsed_at":"2022-08-28T13:41:34.764Z","dependency_job_id":null,"html_url":"https://github.com/darkoatanasovski/htmltags","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/darkoatanasovski/htmltags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkoatanasovski%2Fhtmltags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkoatanasovski%2Fhtmltags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkoatanasovski%2Fhtmltags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkoatanasovski%2Fhtmltags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darkoatanasovski","download_url":"https://codeload.github.com/darkoatanasovski/htmltags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darkoatanasovski%2Fhtmltags/sbom","scorecard":{"id":322784,"data":{"date":"2025-08-11","repo":{"name":"github.com/darkoatanasovski/htmltags","commit":"17ee834f22f041c9b6ee1080ba8a2e6eb580484d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":-1,"reason":"No tokens found","details":null,"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":"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":0,"reason":"Found 0/26 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":"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":-1,"reason":"no dependencies found","details":null,"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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-18T01:47:07.326Z","repository_id":57493013,"created_at":"2025-08-18T01:47:07.326Z","updated_at":"2025-08-18T01:47:07.326Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"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":["crawler","go","golang","html","package","strip","tags","web"],"created_at":"2026-01-17T08:17:51.203Z","updated_at":"2026-01-17T08:17:51.312Z","avatar_url":"https://github.com/darkoatanasovski.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"HTML Strip tags\n=====================\n\n[![Build Status][build-status-svg]][build-status-link]\n[![Docs][docs-godoc-svg]][docs-godoc-link]\n[![Go Report Card][goreport-svg]][goreport-link]\n[![License][license-svg]][license-link]\n\nThis is a Go package which strip HTML tags from a string. Also, you can provide an array of `allowableTags` that can be\nskipped.\nStrip HTML tags library is very useful if you work with web crawlers, or just want to strip all or specific tags from\na string.\n\n```go\nnodes, err := Strip(content string, allowableTags []string, stripInlineAttributes bool) (Nodes, error)\nnodes.Elements //HTML nodes structure of type *html.Node\nnodes.ToString() //returns stripped HTML string\n```\n\n## Installation\n\n```bash\n$ go get github.com/darkoatanasovski/htmltags\n``` \n\n## Parameters\n\n```go\ninput                   - string\nallowableTags           - []string{} //array of strings e.g. []string{\"p\", \"span\"}\nremoveInlineAttributes  - bool // true/false\n```\n\n## Return values\n\nReturns `node` structure. You can get the stripped string with `nodes.ToString()`. If there are errors, it will return\nthe first error message\n\n## Usage\n\nIf you want to keep the inline attributes of the tags, set the third parameter to `false`\n```go\nstripped, err := htmltags.Strip(\"\u003ch1\u003eHeader text with \u003cspan style=\\\"color:red\\\"\u003ecolor\u003c/span\u003e\u003c/h1\u003e\", []string{\"span\"}, false)\n```\n\nOr if you want to strip all tags from the string, and get a pure text, the second parameter has to be\nempty array\n\n```go\nstripped, err := htmltags.Strip(\"\u003ch1\u003eHeader text with \u003cspan style=\\\"color:red\\\"\u003ecolor\u003c/span\u003e\u003c/h1\u003e\", []string{}, false)\n```\n\nA working example\n```go\npackage main\n\nimport(\n    \"fmt\"\n    \"github.com/darkoatanasovski/htmltags\"\n)\n\nfunc main() {\n    original := \"\u003cdiv\u003eThis is \u003cstrong style=\\\"font-size:50px\\\"\u003ecomplex\u003c/strong\u003e text with \u003cspan\u003echildren \u003ci\u003enodes\u003c/i\u003e\u003c/span\u003e\u003c/div\u003e\"\n    allowableTags := []string{\"strong\", \"i\"}\n    removeInlineAttributes := false\n    stripped, _ := htmltags.Strip(original, allowableTags, removeInlineAttributes)\n    \n    fmt.Println(stripped) //output: Node structure\n    fmt.Println(stripped.ToString()) //output string: This is \u003cstrong\u003ecomplex\u003c/strong\u003e text with children \u003ci\u003enodes\u003c/i\u003e\n}\n```\n\n## Development\nIf you have cloned this repo you will probably need the dependency:\n\n`go get golang.org/x/net/html`\n\n## Notes\n\u003e The broken or partial html will be fixed. If your input HTML string is `\u003cp\u003eContent \u003ci\u003eitalic`, \n\u003e the fixed string will be `\u003cp\u003eContent \u003ci\u003eitalic\u003c/i\u003e\u003c/p\u003e` \n\n\n[build-status-svg]: https://api.travis-ci.org/darkoatanasovski/htmltags.svg?branch=master\n[build-status-link]: https://travis-ci.org/darkoatanasovski/htmltags\n[docs-godoc-svg]: https://img.shields.io/badge/docs-godoc-blue.svg\n[docs-godoc-link]: https://godoc.org/github.com/darkoatanasovski/htmltags\n[goreport-svg]: https://goreportcard.com/badge/github.com/darkoatanasovski/htmltags\n[goreport-link]: https://goreportcard.com/report/github.com/darkoatanasovski/htmltags\n[license-svg]: https://img.shields.io/badge/license-BSD--style+patent--grant-blue.svg\n[license-link]: https://github.com/darkoatanasovski/htmltags/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkoatanasovski%2Fhtmltags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkoatanasovski%2Fhtmltags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkoatanasovski%2Fhtmltags/lists"}