This answer only attempts to describe the current behavior of blockquote that makes this issue happening. Note that as of current, there's no 1-click solution to fix the issue mentioned in the question.
When someone selects a paragraph and then click the blockquote button, this is what happens:
- Select a paragraph
- Click the blockquote button
- If the paragraph spans multiple lines, then it will be broken into multiple new lines
- Each line then will be appended with
>
Thus, the following paragraph:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed volutpat mi ex, vel luctus eros pulvinar et. Praesent risus augue, efficitur non magna quis, egestas varius enim. Vestibulum dapibus, velit et tempus porta, felis nunc dignissim nulla, non efficitur eros ipsum sit amet ligula. Praesent in odio accumsan, hendrerit magna at, scelerisque felis. Quisque viverra in augue a bibendum. Quisque id efficitur quam, eu lobortis tellus. Sed nunc est, sagittis eu odio non, finibus scelerisque risus. In quis ultricies sapien. Nulla et augue purus. Vivamus sit amet est non nibh condimentum tempus. Morbi varius, dolor a ullamcorper porttitor, orci lorem convallis tortor, aliquet malesuada tortor nulla id nisl.
Will be quoted as
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed volutpat
> mi ex, vel luctus eros pulvinar et. Praesent risus augue, efficitur
> non magna quis, egestas varius enim. Vestibulum dapibus, velit et
> tempus porta, felis nunc dignissim nulla, non efficitur eros ipsum sit
> amet ligula. Praesent in odio accumsan, hendrerit magna at,
> scelerisque felis. Quisque viverra in augue a bibendum. Quisque id
> efficitur quam, eu lobortis tellus. Sed nunc est, sagittis eu odio
> non, finibus scelerisque risus. In quis ultricies sapien. Nulla et
> augue purus. Vivamus sit amet est non nibh condimentum tempus. Morbi
> varius, dolor a ullamcorper porttitor, orci lorem convallis tortor,
> aliquet malesuada tortor nulla id nisl.
Instead of
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed volutpat mi ex, vel luctus eros pulvinar et. Praesent risus augue, efficitur non magna quis, egestas varius enim. Vestibulum dapibus, velit et tempus porta, felis nunc dignissim nulla, non efficitur eros ipsum sit amet ligula. Praesent in odio accumsan, hendrerit magna at, scelerisque felis. Quisque viverra in augue a bibendum. Quisque id efficitur quam, eu lobortis tellus. Sed nunc est, sagittis eu odio non, finibus scelerisque risus. In quis ultricies sapien. Nulla et augue purus. Vivamus sit amet est non nibh condimentum tempus. Morbi varius, dolor a ullamcorper porttitor, orci lorem convallis tortor, aliquet malesuada tortor nulla id nisl.
Thus, when trying to reverse the blockquote...
- The
>
on each line is removed
- Remove each new line
- Inline them
Which, when applied to a paragraph, probably makes sense, but not for code...
Note: the new Stacks Editor only appends a single >
on the beginning without breaking them into multiple new lines, but it doesn't help when trying to undo blockquoted code.