codex-team / codex-team/editor.js

The sanitize of the save method and the convert to method interfere with each other

Open
#2,814 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

The format required by the block `save` method:
```javascript
static get sanitize(){
return {
url: false,
caption: {
a: true
}
}
}
```
The outermost object returned is a property, not a label.
`convent to` also uses this method, but it passes the result directly as a rule to and HTMLJanitor, as shown in the following figure

![image](https://github.com/user-attachments/assets/023e9c2b-658f-493a-959e-54f3cb98394b)

![11](https://github.com/user-attachments/assets/c983d114-13b0-4582-bb0b-6f422a3f6e0f)

which causes the cleanup to fail.
Also, I noticed that even with the sanitize method configured, the `save` method still didn't clean up the data.

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.