editorjs

package
v0.0.0-...-809e4d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package editorjs implements the alternative Editor.js WYSIWYG provider — example T23 / SPEC V10. Editor.js is a block-style editor from codex-team (Apache-2.0).

This implementation handles the canonical Editor.js v2 block shape:

{
  "time": 1701000000,
  "blocks": [
    {"type":"paragraph","data":{"text":"Hello"}},
    {"type":"header","data":{"text":"Section","level":2}},
    {"type":"list","data":{"style":"unordered","items":["a","b"]}},
    {"type":"image","data":{"file":{"url":"/m/1/a.png"},"caption":"x"}}
  ],
  "version": "2.x"
}

Rendering is intentionally narrow — Editor.js supports many block types via plugins; this covers paragraph + header + list + image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider implements editor.Provider for Editor.js.

func New

func New() *Provider

New returns a fresh Provider.

func (*Provider) EmptyBlocks

func (p *Provider) EmptyBlocks() json.RawMessage

EmptyBlocks implements editor.Provider.

func (*Provider) FrontendBundleID

func (p *Provider) FrontendBundleID() string

FrontendBundleID implements editor.Provider.

func (*Provider) Name

func (p *Provider) Name() string

Name implements editor.Provider.

func (*Provider) Render

func (p *Provider) Render(blocks json.RawMessage) (string, bool)

Render implements editor.Provider.

func (*Provider) Validate

func (p *Provider) Validate(blocks json.RawMessage) error

Validate implements editor.Provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL