Posting Code Results In Mangled Text

Kevin Jones 7,205 Reputation points Volunteer Moderator
2025-07-25T20:45:29.3466667+00:00

When posting code in a code window, the following happens:

  1. Many line feeds are lost resulting in single spaced text.
  2. Extra spaces are appended to the end of lines.
  3. Long lines are wrapped - they should not be wrapped and a horizontal scroll bar displayed.

Kevin

Community Center | Discuss the Q&A site | Site bug or problem
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Kevin Jones 7,205 Reputation points Volunteer Moderator
    2025-07-25T22:17:01.95+00:00

    It looks like it is the code setting. When nothing is selected it posts fine although it should not wrap. When I select Visual Basic for Applications then it gets mangled:

    User's image

    HOWEVER...

    Now I'm going back to reproduce and every time I paste code into a new code block it assumes it's VBA and it not getting mangled.

    User's image

    I don't know what is going on.

    1 person found this answer helpful.
    0 comments No comments

  2. Bruce (SqlWork.com) 79,101 Reputation points Volunteer Moderator
    2025-07-25T22:24:39.09+00:00

    I have better luck toggling the view markdown button when editing code. the code block is just a markdown fenced code block. the language just controls syntax highlighting.

    https://www.markdownguide.org/extended-syntax/

    note: text will wrap when in view markdown mode.

    1 person found this answer helpful.

  3. Alison A 1,575 Reputation points Microsoft External Staff Moderator
    2025-07-25T22:04:04.2433333+00:00

    Hi Kevin,

    Are you selecting the correct development language in the code window? If yes, could you please share an example of the issue you're experiencing?User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.