Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-66437

Allow further customization of the "Code" macro in the new editor

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Macros - Other
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Status Update 18 April 2021

      We have been working to improve the code blocks experience and in regard to this ticket requests', we already shipped the following capabilities 1. Showing line numbers & 2. A handy Copy button, that could allow users to copy the content from this macro. We recommend for you to follow this ticket for the rest of the requests. Meanwhile, for collapsing the code block, one workaround that could elevate some of the pain is to put code blocks inside expands.

      Thanks,
      Yousef

      Allow further customization of the "Code" macro in the new editor. The "Code" macro replaced "Code Block" macro, but it does not allow as many customization options as the macro it replaced.

      Current Situation

      Currently, the "Code" macro replaced the "Code Block" macro in the new editor, but this new macro won't provide users with much customization options (just its width) as much as the old macro did. This includes:

      • Change the background color (theme)
      • Collapse
      • Show line numbers
      • A handy Copy button, that could allow users to copy the content from this macro;

      Point of attention

      It seems that this macro is not currently highlighting some languages, an example of this is "Shell" as can be seen in the next screenshot no syntax highlight is present in this simple line of code

      Additional Note
      Provide support for other languages too, e.g. MatLab

            [CONFCLOUD-66437] Allow further customization of the "Code" macro in the new editor

            I also ran into these issues so I made an Enhanced Code Block macro for Confluence that is available on the Marketplace now.

            It supports changing themes, collapsing, auto-collapsing, syntax highlighting for over 300 languages and many other enhancements.

            You can get it here https://marketplace.atlassian.com/apps/1235192/enhanced-code-block-for-confluence

            thanks,

            Matt

            Matthew Grover added a comment - I also ran into these issues so I made an Enhanced Code Block macro for Confluence that is available on the Marketplace now. It supports changing themes, collapsing, auto-collapsing, syntax highlighting for over 300 languages and many other enhancements. You can get it here https://marketplace.atlassian.com/apps/1235192/enhanced-code-block-for-confluence thanks, Matt

            Why is this closed? They closed a ticket to add coloring to these code blocks because it duplicated this ticket, and this was closed without resolving that.

            Being able to change the background color of the code block is important - when you want to highlight unacceptable examples, a red background would be good. Simple markup does this, why can't this macro

             

            Rick Hadsall added a comment - Why is this closed? They closed a ticket to add coloring to these code blocks because it duplicated this ticket, and this was closed without resolving that. Being able to change the background color of the code block is important - when you want to highlight unacceptable examples, a red background would be good. Simple markup does this, why can't this macro  

            Simon Owen added a comment -

            Please add / fix the syntax colour highlighting.

            Simon Owen added a comment - Please add / fix the syntax colour highlighting.

            @Zak you can accomplish the collapse option by first adding an expand object in which you can add a code. Unfortunately, you can't add it in a cell of a table.

            Richard Kelters added a comment - @Zak you can accomplish the collapse option by first adding an expand object in which you can add a code. Unfortunately, you can't add it in a cell of a table.

            Zak added a comment -

            Why is this closed? 

            The code block needs to have a collapse button!

            Sometimes when pasting in 300 lines of code, it can be tricky to manage. I would like to expand and collapse the code as needed. This is basic functionally. 

             Please re-open this ticket! 

            Zak added a comment - Why is this closed?  The code block needs to have a collapse button! Sometimes when pasting in 300 lines of code, it can be tricky to manage. I would like to expand and collapse the code as needed. This is basic functionally.   Please re-open this ticket! 

            Jeff Haws added a comment -

            Just spent 20 min trying to figure out why the code block was missing, landed here. 

            Only to find it closed with "we did our best". 

            Jeff Haws added a comment - Just spent 20 min trying to figure out why the code block was missing, landed here.  Only to find it closed with "we did our best". 

            Homer AD added a comment - - edited

            I think closed in this case translates to 'we don't care'.

            Homer AD added a comment - - edited I think closed in this case translates to 'we don't care'.

            This is still not resolved.....I'm just echoing at this point I guess.

            Jonathan Tyler Gish added a comment - This is still not resolved.....I'm just echoing at this point I guess.

            This really needs to be re-reviewed and re-opened as the functionality for highlighting the most common code languages as a bare minimum (C++, C#, JAVA, HTML, CSS, SQL, etc.) isn't even implemented.

            Jon Johnson added a comment - This really needs to be re-reviewed and re-opened as the functionality for highlighting the most common code languages as a bare minimum (C++, C#, JAVA, HTML, CSS, SQL, etc.) isn't even implemented.

            Saagar Kurani added a comment - - edited

            This is definitely not resolved, can we request to have the ticket reopend? This great dimensions our use of confluence as our main creation point for our documentation.   (at least for us). 

            Saagar Kurani added a comment - - edited This is definitely not resolved, can we request to have the ticket reopend? This great dimensions our use of confluence as our main creation point for our documentation.   (at least for us). 

              Unassigned Unassigned
              halegra Helton A. (Inactive)
              Votes:
              454 Vote for this issue
              Watchers:
              237 Start watching this issue

                Created:
                Updated:
                Resolved: