3 Replies Latest reply on Aug 7, 2017 7:03 AM by BluShadow

    how to preserve formatting of copied content to a post?

    chathu

      Hi All,

       

      Recently I have a question related to sql performance and when I had posted it on the relevant space I noticed that some of the content copied like execution plan output is not arranged to nice format. Are there any enclosing tags that I could have used to preserve format in that post ? Can you give me some knowledge and tips on this

       

      Best Regards,

      Chathu

        • 1. Re: how to preserve formatting of copied content to a post?
          BluShadow

          When posting content that contains code or fixed width text, where you want to preserve the layout you have two options...

          Both of these require using the "Advanced Editor" so you should always post/reply from the thread itself, and not from the Inbox; as the Advanced Editor option isn't available through the inbox (yet!)

           

          Firstly post your code/formatted content, in to the editor and highlight it all

           

          option 1) Click on the double chevron ">>" icon on the editor toolbar, a drop down menu appear, select Syntax Highlighting and then pick SQL

          option 2) Click on the "Font Family" drop down in the editor toolbar and pick "Courier New" as your font; (optionally) also then click the double chevron ">>" icon and choose "Quote" as this will embed the code in a frame within the post

           

          Note: with option 1, the syntax highlighting will put line numbers in front of each line, and this can be problematic if people want to copy out the code/text for themselves as they end up with all those line numbers that they have to remove before they can use it.  Personally, I prefer option 2.

          1 person found this helpful
          • 2. Re: how to preserve formatting of copied content to a post?
            chathu

            Hi BluShadow,

             

            Thank you very much for the response and it's worked nicely. Also in another post publisher mentioned about some tag related to format preserving (eg: \)

            Here the link HOW TO: Post a SQL statement tuning request - template posting .

            Do you know about these kind of tags where we can include in a post? Because I couldn't find a way to get the expected result from a tag where your method worked as a charm.

             

            Best Regards

            Chathu

            • 3. Re: how to preserve formatting of copied content to a post?
              BluShadow

              That's an old post from 2009.

              Back then, the community forums supported various standard formatting tags such as [code] and [/code], but those are no longer used, so when Randolf refers to the "/" tag, he's meaning that the user should ensure they used the [/code] closing tag after the formatted code.

              That no longer works, so ignore it.