Anybody else noticed an influx of code formatted as individual lines?

Another example of post corruption specific to the "rich text editor":

Minimal reproduction:

  1. Add the following content to the Arduino IDE 2.x editor:

    foo
        [i]
    bar
    
    • The fault is specific to content copied from the Arduino IDE 2.x editor due to the way it populates the clipboard with formatted (text/html type) data, instead of only plaintext (text/plain kind) data as you would obtain by copying from other applications (including Arduino IDE 1.x).
    • The leading spaces on the line that contains content resembling BBCode markup are required, as these act as code block markup (alternative syntax to fenced code block markup.
    • The foo and bar lines are not required to reproduce the fault, but were added to make the nature of the fault more clear.
  2. Select the content from the Arduino IDE editor.

  3. Do a standard copy (not using the "Copy for Forum (Markdown)" feature) of the content from the Arduino IDE editor.

  4. Open a post composer.

  5. Put the post composer in the "rich text editor" mode.

  6. Paste the copied content into the composer.
    The corruption will not be visible in the composer.

  7. Publish the post.

The post will have the following corrupted form:


foo

\[i\]

bar


The problem does not occur if the user posts the code correctly, by any of the available methods (the "Copy for Forum (Markdown)" feature, proactively activating a code block, retroactively applying code formatting to the selection. So it is more a matter of user error since we expect corruption of code that is not posted correctly. However, this is distinctive in a couple of ways:

  • The corruption is not visible in the post preview
  • The corrupted code is rendered in a code block