codex-team / codex-team/editor.js

Add toHTML() interface for **block copy**💡

Open
#1,439 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

1. Describe a problem.
Editor.js doesn't support HTML output, but Editor.js does output a HTML!
There is in the HTML copy function.
https://github.com/codex-team/editor.js/blob/next/src/components/modules/blockSelection.ts#L300

Editor.js output a HTML based on the rendered block holder.
It means each block tools can't include input labels, button, and other UI components.
For example, when copy Image tool and paste to Google Document,
pasted HTML data includes unexpected "Select an Image" text.

![Screenshot from 2020-11-24 20-37-46-1](https://user-images.githubusercontent.com/7702653/100089434-042d1400-2e95-11eb-9684-6dd995bd4326.png)

2. Describe the solution you'd like. Mockups are welcome.

Add `toHTML()` interface to each block tool.
If `toHTML()` is not implemented, Editor.js outputs the block holder HTML.
Because `toHTML()` is optional method, there is no breaking changes.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.