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

Code Block - Language: PowerShell - Refined code highlighting

XMLWordPrintable

    • 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.

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      I'd love to have some refinements to the codeblock parsing of the supported PowerShell highlighter:

      • Everything between '<#' and '#>' (not counting the single hyphens) is a comment. even - or rather especially - if it spans multiple lines.
      • If behind the command "New-Object" is a string with dots inbetween (like ABC.DEF.GHI), that's a .NET class. Special highlighting for that might be appropriate.
      • [ABC.DEF.GHI] is another .NET specific notation
      • [ABC.DEF.GHI]::Function() is calling a .NET function (or property, if called without the "()"). Highlighting those function or property-stubs separately would be great
      • Functions and their parameters appear to be colored in the same color ("Select-Object -First"). I'd much appreciate if those could be varied, so that functions and parameters have similar colors (Example: Functions get a dark blue and parameters a light blue). Powershell code frequently consists of long chains of Function Pipelines with little but functions and their parameters.
      • There is a way in powershell to create a string object across multiple lines: They start with '@"' and end with '"@' (without the single hyphens, but with the double ones). This is not supported in the PowerShell highlighter so far.

      All those would be nice-to-have, though hardly worldshaking, features

              smansour Sherif Mansour
              350037d2b12c Friedrich Weinmann
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: