codex-team / codex-team/editor.js

[Bug] The copied HTML data from Editor.js have wrong <p>

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

Description

Describe a bug.
The copied HTML data from Editor.js have wrong `

`.
`

` can't contain `

`~`

` tags by HTML syntax rule.
https://stackoverflow.com/questions/15656785/should-a-heading-be-inside-or-outside-a-p

Steps to reproduce:
1. Instert the following debug code.

`src/components/modules/rectangleSelection.ts` line 307
```typescript
const textHTML = fakeClipboard.innerHTML;

console.log(textHTML); // debug code

e.clipboardData.setData('text/plain', textPlain);
```

2. Copy an heading block by `ctrl + c` in `example/example-dev.html`

![Screenshot from 2021-04-11 22-27-54](https://user-images.githubusercontent.com/7702653/114306000-5eadd080-9b15-11eb-94f1-0458cf7eaa53.png)

3. The wrong HTML is output to console.

```html

Editor.js


```

Expected behavior: `

` should be used instead of `

`.

Editor.js version: 2.20.1

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.