none
Code Block edit bug? RRS feed

  • Question

  • If I insert a code block into a post, then later edit the post, the code block gets extra new lines added to it.

    Steps:
    1) 'ask a question'
    2) Click 'insert code block' Body tool icon
    3) Enter something like 'line 1 <carriage return> line 2'
    4) Submit
    5) Edit post, Submit
    6) View post, notice additional blank lines between line 1 and line 2, if not repeat from step 5
    Sunday, June 14, 2009 7:51 AM

Answers

All replies

  • We had a previous bug on this and afaik had been fixed as part of last months release. We'll verify in our end.

    Thanks
    STO Forums Test Lead
    Sunday, June 14, 2009 7:39 PM
  • Verifying bug (V2):

    - Edit this time.....
    - Edit again. Insert Code Line after "Public Class Form1"

    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MessageBox.Show("Hello World", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub End Class

    STO Forums Test Lead

    • Edited by Don Tan Sunday, June 14, 2009 7:44 PM Edit Code block again
    Sunday, June 14, 2009 7:40 PM
  • Seems to work for me. What browser are you using? FF, IE?

    STO Forums Test Lead
    Sunday, June 14, 2009 7:43 PM
  • This is easy to repro for me in IE7.  Every time you click Edit, the lines in the code block get double-spaced vertically, even though they are in a <pre> block.  Why this might be so isn't visible in the HTML editor, they are no visible <p> or <br/> elements, just blank lines.  This of course quickly makes the code snippet unreadable and drives the poster pretty nuts.  Seeing them editing the post 5 times in a row with choice remarks is common.

    There's another mode that IE users can get into, I haven't figured that one out yet.  It puts every word on a line by itself, often with changing font sizes.  Those are really impossible to read.

    Hans Passant.
    Sunday, June 14, 2009 9:33 PM
  • For example (now posting with IE7):

      public partial class Form1 : Form {
        public Form1() {
          InitializeComponent();
        }
    
        private void button1_Click(object sender, EventArgs e) {
          splitContainer1.Panel1Collapsed = !splitContainer1.Panel1Collapsed;
        }
      }
    

    Hans Passant.
    Sunday, June 14, 2009 9:34 PM
  • Hmm, now it doesn't repro like it did in the Moderator's Sandbox.   I don't get the snippet double-spaced, I get a completely blank post when I click Edit.  I can see the original post briefly flash before it completely disappears.  The HTML editor shows nothing.  The post looks really weird too in IE7, it has a font that doesn't have ClearType turned on.

    This is way too weirdo for me, I'm running back to FireFox now...
    Hans Passant.
    Sunday, June 14, 2009 9:46 PM
  • Here's the post that shows the same effect in a publicly accessible forum.

    Hans Passant.
    Sunday, June 14, 2009 9:52 PM
  • Thanks for contributing info nobugz

    For me, I encountered this issue yesterday.
    I'm using FireFox 3.5 Preview .
    I'm not sure that the issue occurred every edit, but frequently enough to be noticeable.
    I usually edit posts to add or clarify information. When half my edits were to fix code block spacing, I removed the code block.
    In this case, I had text above and below the code block.  Most edits were below the code block.
    Monday, June 15, 2009 3:28 AM
  • Add a tab character to the test.

    Editing the post brings up a different screen every other time it is edited.

    FF Test:
    1) Post "Moo    Cow" (with a tab in between the words)
    2) Highlight the line
    3) Click code thingy
    4) Click Insert
    5) Submit
    6) Click edit. (normal edit appears)
    7) Click submit.
    8) Click edit (other edit box appears, with PRE tags, and Resource.HasCodeLabel checkbox)
    9) Click submit
    10) Repeats steps 6-9 to see the alternates.


    IE 6 Test 1:

    1) Post "Moo    Cow" (with a tab in between the words)
    2) Highlight the line
    3) Click code thingy
    4) Click Insert
    5) Submit
    6) Click edit. (normal edit appears, message is empty and there are no buttons)
    7) Press F5 (page is refreshes)
    8) Click edit for message on bottom (it has text, normal edit appears under original post, message is empty but there are buttons)
    9) Click submit (error message box is displayed: Body must be 4 to 60000 characters long.)
    10) Click OK (makes message box go away)
    11) Press F5 (refreshes page, Message appears again with text.)
    12) Goto step 8.


    IE 6 Test 2:
    1) Post "Moo    Cow" (with a tab in between the words)
    2) Submit
    3) Click edit. (normal edit appears, but all other replies appear blank)
    4) Highlight the line
    5) Click code thingy
    6) Click Insert
    7) Click submit.
    8) Click edit (other edit box appears, with PRE tags, and Resource.HasCodeLabel checkbox)
    9) Click submit
    10)Click edit (regular edit appears, but all other replies go blank)
    11) Click submit (page refreshes, only original post is shown)
    12) Refresh
    13) Click edit (post on bottom) (edit dialog appears under original post)
    14) goto step 11.





    Monday, June 15, 2009 12:02 PM
  • Btw, one of our dev's is looking into the problem as to why contents of a message clears out when editing a post.

    We'll provide status on this thread.
    STO Forums Test Lead
    Wednesday, June 17, 2009 4:20 PM