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

When calling state.setHtml(html) method for rendering a HTML Ordered list , each <li> tag is rendered as a new Ordered list #258

Open
kannansrepo opened this issue Apr 20, 2024 · 2 comments

Comments

@kannansrepo
Copy link

kannansrepo commented Apr 20, 2024

if you add a OL with three LI as follows:

  1. test1
  2. test2
  3. test3

it is rendered as :
1 test1
1 test2
1 test3
refer screenshot attached

expected:

  1. test1
  2. test2
  3. test3

Screenshot_20240420_151524

@kannansrepo kannansrepo changed the title When setting HTML Ordered list , each <li> tag is rendered as a new Ordered list When calling state.set() method for rendering a HTML Ordered list , each <li> tag is rendered as a new Ordered list Apr 20, 2024
@kannansrepo
Copy link
Author

This basically happens because of the RichtextHTMLParser creates new OL for each LI. Line number 106

@kannansrepo kannansrepo changed the title When calling state.set() method for rendering a HTML Ordered list , each <li> tag is rendered as a new Ordered list When calling state.setHtml(html) method for rendering a HTML Ordered list , each <li> tag is rendered as a new Ordered list Apr 20, 2024
@kannansrepo
Copy link
Author

I created a counter for each li and updated the number in constructor of OrderedList ParagraphType. This fixed the issue for now, however I believe all the LI has to be a part of same OL object.

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

No branches or pull requests

1 participant