codex-team / codex-team/editor.js

renderFromHTML does not properly render nestedlist

Open
#2,385 1 comment 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

My flow in a project is to get some text in markdown format from an API then convert to it html using [markdown-it](https://github.com/markdown-it/markdown-it) and then use renderFromHTML utility on editorjs. I've tried few stuff and its working great but when I try to add a nested list using html it does render it but append nested list as a normal list in the end. Let me show you what I mean.

Steps to reproduce:

1. This is a nested list code from w3school:
![Screenshot from 2023-06-19 02-19-27](https://github.com/codex-team/editor.js/assets/74908127/812440f3-f501-45a5-9bbe-18abbe8654f8)

2. Now when let's paste this html code inside renderFromHTML
![Screenshot from 2023-06-19 02-25-48](https://github.com/codex-team/editor.js/assets/74908127/4767bae2-7bd7-46c0-9f73-17d96378ddd7)

3. Now this is the output:
![Screenshot from 2023-06-19 02-26-53](https://github.com/codex-team/editor.js/assets/74908127/b7695888-8332-4f73-8ffe-11474f26f472)

Expected behavior:
![Screenshot from 2023-06-19 02-27-49](https://github.com/codex-team/editor.js/assets/74908127/5a279dfe-2da0-46af-b6d4-213bcc578ce4)

**OS**: Ubuntu 20.04.6 LTS
**Browser**: FireFox

**Editor.js version**: 2.27.0

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.