sanity-io / sanity

Sanity Studio – Rapidly configure content workspaces powered by structured content
https://www.sanity.io
MIT License
5.27k stars 426 forks source link

Sanity Studio Rich Text Editor does not properly close 3rd level ordered list tags #6879

Closed slegay closed 1 month ago

slegay commented 4 months ago

If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.

Describe the bug

When writing nested ordered lists, if a sub-list ends with a 3rd degree tabbed list, the next number is wrong. It seems that an ol tag is not getting properly closed.

To Reproduce

Create this ordered list in Sanity portable text editor editor, as shown in the screenshot.

image

Expected behavior

c should be a

Screenshots

image

Which versions of Sanity are you using?

@sanity/cli (global) 3.45.0 (up to date) @sanity/dashboard 3.1.6 (up to date) @sanity/google-maps-input 4.0.1 (up to date) @sanity/ui 2.3.1 (up to date) @sanity/uuid 3.0.2 (up to date) @sanity/vision 3.45.0 (up to date) sanity 3.45.0 (up to date)

What operating system are you using?

Ubuntu

Which versions of Node.js / npm are you running?

9.8.1 v18.18.2

Additional context

The problem goes away when adding a level 2 item after finishing a level 3 ordered list, and before starting a new level 1 list item, as shown below:

image

joelschneider commented 3 months ago

+1

The issue is even broader I believe.

If you have more than one simple ordered list in a portable text editor, the following ordered lists continue the numbering from the previous ordered list.

Example:

  1. ...
  2. ...
  3. ...

[Other content]

  1. ...
  2. ...

Very annoying tbh, as this renders this basic functionality useless if you have more than one ordered list in an article.

christianhg commented 2 months ago

Hi there! Just want to let you all know that the problem that @joelschneider describes should be fixed by v3.53.0. Related PR: https://github.com/sanity-io/sanity/pull/7286

However, the problem described in the OP is not fixed yet. It's in our backlog though!

christianhg commented 1 month ago

This problem has now been fixed in https://github.com/sanity-io/sanity/pull/7506. Thanks again @phattran2905 !