Uploaded image for project: 'jboss.org'
  1. jboss.org
  2. ORG-641

Cut and paste in a syntax highlighting block is broken

XMLWordPrintable

    • Hide

      Start a post. Insert a syntax highlighting block (XML). Type in some XML. Then copy some of the XML and paste it into the middle of the box. It appears to work (as long as you don't switch to HTML mode). Then publish the post or article. Notice the incorrect formatting. Go in to edit the post and notice the wrong formatting. Try to fix the formatting on the full editor and republish; notice the formatting is still wrong. Fix the formatting in the HTML editor for it to "stick".

      Show
      Start a post. Insert a syntax highlighting block (XML). Type in some XML. Then copy some of the XML and paste it into the middle of the box. It appears to work (as long as you don't switch to HTML mode). Then publish the post or article. Notice the incorrect formatting. Go in to edit the post and notice the wrong formatting. Try to fix the formatting on the full editor and republish; notice the formatting is still wrong. Fix the formatting in the HTML editor for it to "stick".

      Two problems with cut & paste in a Syntax Highlighting section of a post.

      1) If you cut text from a text editor and paste it into an SBS syntax highlighting block (especially XML), it inserts an extra newline between every line.
      2) If you cut text from within the syntax highlighting block and then re-paste it, it inserts another redundant layer of <pre> tags, which then confuses the editor resulting in incorrect formatting and possible lost data. The only fix is to enter the HTML editing mode and find and remove the extra <pre> tags by hand. Except while you do this, the HTML editing mode reformats the HTML and moves your cursor as you type, as it tries to deal with the invalid HTML, so this is quite tricky.

              lkrzyzan@redhat.com Libor Krzyzanek
              dlloyd@redhat.com David Lloyd
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: