Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(normalzeData): convert current line to heading fixed #116

Merged
merged 2 commits into from
Jul 13, 2024

Conversation

dependentmadani
Copy link
Contributor

Problem

The data get removed when converting a line content into heading. Issue #114

Cause

The normalizeData function requires both data.text and data.level to be present for the data to be considered valid. If data.level is missing, the entire content, including data.text, is discarded and default values are used.

Solution

Modify the normalizeData function to retain data.text even if data.level is missing. Assign data.level to a default value (this.defaultLevel.number) if it is not provided or invalid. This ensures that valid text content is preserved even when the level is missing.

@neSpecc neSpecc merged commit d5fc14d into editor-js:master Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants