Multiple Line breaks lost in Code Snippets

  • Something I noticed while editing an article, and noticed that where I normally leave a blank line in code, it wasn't showing in the preview. Not sure if I replicates to forums as well, but will try to demonstrate here regardless.

     

    When you have multiple consecutive line breaks in a code snippet, they appear to be turned into one. For example the below code I'll write as:

    DECLARE @Var1 int = 1; --Line Break

    DECLARE @Var2 int = 2; --Line Break

    --Line Break

    SELECT * --Line Break

    FROM Table --Line Break

    WHERE Column1 = @Var1 --Line Break

    AND Colum2 = Var2;

    And now, in the SQL snippet:

    DECLARE @Var1 int = 1;
    DECLARE @Var2 int = 2;

    SELECT *
    FROM Table
    WHERE Column1 = @Var1
    AND Colum2 = Var2;

    Notice there is no gap between the 2nd DECLARE statement and the start of the SELECT. This isn't a biggy, I admit, but would be good if the code snippets reflected the way the code had been written in it's entirety.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Test reply with code:

    DECLARE @Var1 int = 1; -–Line Break
    DECLARE @Var2 int = 2; -–Line Break


    SELECT * –-Line Break
    FROM Table -–Line Break
    WHERE Column1 = @Var1 -–Line Break
    AND Colum2 = Var2;
  • OK, I'll file a bug here. Something in the formatting is stripping line breaks.

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply