Quoting bullets nested under numbers breaks formatting

When you use the quote button to quote a part of a post that has bullets nested under numbers, the nested bullets no longer indent correctly.

1. one
   - a
2. two
   - b

Try quoting this:

  1. one
    • a
  2. two
    • b
- one
  - a
- two
  - b

And then try quoting this:

  • one
    • a
  • two
    • b

The first one “breaks” when it is quoted, with improper indentation.

Before quote:

Screenshot 2023-06-02 at 6.43.55 AM

After quote:

Screenshot 2023-06-02 at 6.44.32 AM

Notably, to get things to indent correctly in the first place, the bullets underneath numbers require three leading spaces. The bullets underneath bullets only require two leading spaces. When quoting, it appears that one of the three leading spaces in the first example gets removed somehow, leading to the broken formatting.

4 Likes

Test cases

That’s the nature of numbered lists. The same thing happens in Gmail or a word processor

1 Like

Hmm… I don’t quite follow. Google Docs doesn’t have a quote feature I’m aware of, and I don’t see this issue with copy/paste within a Google Doc.

Oh, I think you mean that “copy / paste HTML” also suffers from the same issue?

Yes, if I copy the above and past it here I do get:

Try quoting this:

  1. one
  • a
  1. two
  • b

And if I copy similar text from a Google Doc, I also get a similar (but slightly different) problem:

  1. Foo
  • A
  1. Bar
  • B

Does look like the same issue on the surface, but I don’t know enough about the implementation of quoting a post to say whether these have the same underlying cause or not though…

When I copy and paste a set of numbered items in Gmail and mark them as a quote and then insert text between them they reset to one for each item.

How do you propose that the problem be solved?

Now I feel like we’re talking about a third issue…

What I’m complaining about here is how the indentation gets broken of the nested bullets… not any renumbering.

Before quote:

Screenshot 2023-06-02 at 6.43.55 AM

After quote:

Screenshot 2023-06-02 at 6.44.32 AM

(I’ve edited the original post to include those images now)

3 Likes

Discourse uses MarkdownIt (which follows CommonMark spec), and the issue happens there as well:

https://spec.commonmark.org/dingus/?text= >%201.%20item%20one >%20%20%20-%20sublist >%202.%20item%20two >%20%20%20-%20sublist >%20%20%20-%20sublist >%20-%20item%20one >%20-%20item%20two >%20%20%20-%20sublist >%20%20%20-%20sublist

4 Likes

I think though that we can easily work around this in our quote code, given one extra space sorts it out…

VS:

[quote="Dave McClure, post:1, topic:266836, username:mcwumbly"]
Try quoting this:

1. one
  * a
2. two
  * b
[/quote]

VS:


[quote="Dave McClure, post:1, topic:266836, username:mcwumbly"]
Try quoting this:

1. one
   * a
2. two
   * b
[/quote]
5 Likes