{"id":13770912,"url":"https://github.com/davidscottmills/goeditorjs","last_synced_at":"2026-01-16T07:09:03.612Z","repository":{"id":57557909,"uuid":"321100332","full_name":"davidscottmills/goeditorjs","owner":"davidscottmills","description":"An HTML/markdown generator for editorjs.","archived":false,"fork":false,"pushed_at":"2022-02-02T20:23:19.000Z","size":28,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-11T03:36:15.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/davidscottmills.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":"2020-12-13T15:46:22.000Z","updated_at":"2025-05-06T10:12:25.000Z","dependencies_parsed_at":"2022-08-28T11:41:40.512Z","dependency_job_id":null,"html_url":"https://github.com/davidscottmills/goeditorjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/davidscottmills/goeditorjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidscottmills%2Fgoeditorjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidscottmills%2Fgoeditorjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidscottmills%2Fgoeditorjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidscottmills%2Fgoeditorjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidscottmills","download_url":"https://codeload.github.com/davidscottmills/goeditorjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidscottmills%2Fgoeditorjs/sbom","scorecard":{"id":327608,"data":{"date":"2025-08-11","repo":{"name":"github.com/davidscottmills/goeditorjs","commit":"6e56c4da86118ad0f626923dd50f2750be3c6170"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/20 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":"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":"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":"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":"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/coverage.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/test.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/davidscottmills/goeditorjs/test.yaml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/coverage.yaml:1","Warn: no topLevel permission defined: .github/workflows/test.yaml: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":"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":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 'main'"],"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":"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"}}]},"last_synced_at":"2025-08-18T02:50:53.732Z","repository_id":57557909,"created_at":"2025-08-18T02:50:53.732Z","updated_at":"2025-08-18T02:50:53.732Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":[],"created_at":"2024-08-03T17:00:44.549Z","updated_at":"2026-01-16T07:09:03.589Z","avatar_url":"https://github.com/davidscottmills.png","language":"Go","funding_links":[],"categories":["Libraries"],"sub_categories":["Go"],"readme":"# davidscottmills/goeditorjs\n\nAn extensible library that converts [editor.js](https://editorjs.io/) data into HTML or markdown.\n\n[![test and build](https://github.com/davidscottmills/goeditorjs/workflows/test%20and%20build/badge.svg)](https://github.com/davidscottmills/goeditorjs/actions?query=workflow%3A%22test+and+build%22)\n[![Coverage Status](https://coveralls.io/repos/github/davidscottmills/goeditorjs/badge.svg?branch=main)](https://coveralls.io/github/davidscottmills/goeditorjs?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/davidscottmills/goeditorjs)](https://goreportcard.com/report/github.com/davidscottmills/goeditorjs)\n[![Documentation](https://godoc.org/github.com/davidscottmills/goeditorjs?status.svg)](http://godoc.org/github.com/davidscottmills/goeditorjs)\n[![GitHub issues](https://img.shields.io/github/issues/davidscottmills/goeditorjs.svg)](https://github.com/davidscottmills/goeditorjs/issues)\n[![license](https://img.shields.io/github/license/davidscottmills/goeditorjs.svg?maxAge=2592000)](https://github.com/davidscottmills/goeditorjs/LICENSE.md)\n[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/davidscottmills/goeditorjs.svg)](https://github.com/davidscottmills/goeditorjs)\n\n## Installation\n\n```bash\ngo get github.com/davidscottmills/goeditorjs\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\n\t\"github.com/davidscottmills/goeditorjs\"\n)\n\nfunc main() {\n\tcontent, err := ioutil.ReadFile(\"editorjs_output.json\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tejs := string(content)\n\n    // HTML\n    // Get the HTML engine\n    htmlEngine := goeditorjs.NewHTMLEngine()\n    // Register the handlers you wish to use\n\thtmlEngine.RegisterBlockHandlers(\n\t\t\u0026goeditorjs.HeaderHandler{},\n\t\t\u0026goeditorjs.ParagraphHandler{},\n\t\t\u0026goeditorjs.ListHandler{},\n\t\t\u0026goeditorjs.CodeBoxHandler{},\n\t)\n    // Generate the html\n\thtml, err := htmlEngine.GenerateHTML(ejs)\n\tif err != nil {\n\t\tlog.Fatal(err)\n    }\n\n    // Do something with the html output. In this case, write it to a file.\n\terr = ioutil.WriteFile(\"editorjs.html\", []byte(html), 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n    // Generate markdown and save it to a file\n    // Get the markdown engine\n\tmarkdownEngine := goeditorjs.NewMarkdownEngine()\n    // Register the handlers you wish to use\n\tmarkdownEngine.RegisterBlockHandlers(\n\t\t\u0026goeditorjs.HeaderHandler{},\n\t\t\u0026goeditorjs.ParagraphHandler{},\n\t\t\u0026goeditorjs.ListHandler{},\n\t\t\u0026goeditorjs.CodeBoxHandler{},\n    )\n    // Generate the markdown\n\tmd, err := markdownEngine.GenerateMarkdown(ejs)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n    // Do something with the md output. In this case, write it to a file.\n\terr = ioutil.WriteFile(\"editorjs.md\", []byte(md), 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n## Using a Custom Handler\n\nYou can create and use your own handler in either engine by implementing the required interface and registering it.\nThis package provides two interfaces for handlers.\n\n- `HTMLBlockHandler`\n\n  ```go\n  type HTMLBlockHandler interface {\n      Type() string // Type returns the type the block handler supports as a string\n      GenerateHTML(editorJSBlock EditorJSBlock) (string, error) // Return associated HTML\n  }\n  ```\n\n- `MarkdownBlockHandler`\n  ```go\n  type MarkdownBlockHandler interface {\n      Type() string // Type returns the type the block handler supports as a string\n      GenerateMarkdown(editorJSBlock EditorJSBlock) (string, error) // Return associated markdown\n  }\n  ```\n\nIf you're only planning to use the HTMLEngine, then you only need to implement the `HTMLBlockHandler` interface. The same goes for markdown.\n\nOnce you've met the required interface, register the handler for use in the engine.\n\n```go\nhtmlEngine := goeditorjs.NewHTMLEngine()\n// Register the handlers you wish to use\nhtmlEngine.RegisterBlockHandlers(\n    \u0026MyCustomBlockHandler{},\n)\n```\n\nBelow is an example of how the header handle is implemented.\n\n```go\npackage header\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// HeaderHandler is the default HeaderHandler for EditorJS HTML generation\ntype HeaderHandler struct {\n    // Notice that you could put some configurable options in this struct and then use them in your handler\n}\n\n// Header represents header data from EditorJS\ntype Header struct {\n\tText  string `json:\"text\"`\n\tLevel int    `json:\"level\"`\n}\n\nfunc (*HeaderHandler) parse(editorJSBlock EditorJSBlock) (*Header, error) {\n\theader := \u0026Header{}\n\treturn header, json.Unmarshal(editorJSBlock.Data, header)\n}\n\n// Type \"header\"\nfunc (*HeaderHandler) Type() string {\n\treturn \"header\"\n}\n\n// GenerateHTML generates html for HeaderBlocks\nfunc (h *HeaderHandler) GenerateHTML(editorJSBlock EditorJSBlock) (string, error) {\n\theader, err := h.parse(editorJSBlock)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn fmt.Sprintf(\"\u003ch%d\u003e%s\u003c/h%d\u003e\", header.Level, header.Text, header.Level), nil\n}\n\n// GenerateMarkdown generates markdown for HeaderBlocks\nfunc (h *HeaderHandler) GenerateMarkdown(editorJSBlock EditorJSBlock) (string, error) {\n\theader, err := h.parse(editorJSBlock)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn fmt.Sprintf(\"%s %s\", strings.Repeat(\"#\", header.Level), header.Text), nil\n}\n```\n\n## TODO\n\n- Provide more handlers (table, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidscottmills%2Fgoeditorjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidscottmills%2Fgoeditorjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidscottmills%2Fgoeditorjs/lists"}