editorjs-go-list is an official plugin for editorjs-go that provides rendering support for Editor.js list blocks into safe and semantic HTML output.
- ✅ Supports both unordered (
<ul>) and ordered (<ol>) lists - ✅ Escapes HTML entities for each list item
- ✅ Simple integration with
editorjs-go - 🧩 Zero dependencies and clean output
Install the plugin along with editorjs-go:
go get github.com/christiandenisi/editorjs-go
go get github.com/christiandenisi/editorjs-go-listpackage main
import (
"fmt"
"github.com/christiandenisi/editorjs-go"
"github.com/christiandenisi/editorjs-go-plugin-list/list"
)
func main() {
jsonData := []byte(`{
"time": 1234567890,
"version": "2.27.0",
"blocks": [
{
"type": "list",
"data": {
"style": "unordered",
"items": ["First", "Second"]
}
}
]
}`)
conv := editorjs.New()
editorjs.Register(conv, "list", list.RenderList)
html, err := conv.Convert(jsonData)
if err != nil {
panic(err)
}
fmt.Println(html)
}- Escaping is handled using
html.EscapeString(...) - If the list is empty, it returns an empty string (
"")
This plugin is compatible with:
editorjs-goversion1.x
MIT – free to use, modify, and distribute.