Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-66828

Allow line numbers and line highlighting for code-blocks

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Rich Text Editor
    • None
    • 4
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      We used to use the Jira Syntax Highlighter Plugin before (mostly because the old code-markdown didn't support C#) and were delighted to see that newer versions extended on the language support (which now includes C# by default). As such, the plugin has been discontinued.

      One feature we still miss though is the ability to specify whether a code-block should include line numbers or not; whether to start line numbering in a different place (other than 1) and whether to highlight certain lines.

      For example, the following would show the lines 305-310 of Program.cs and highlight lines 307-309 to bring them to the developers attention:

      {code:csharp|title=Program.cs|linenumbers|firstline=305|highlight=307-309}private static void DoSomething(string someValue, out int someNumber)
      {
          someNumber = 42; // why 42?
          if (someValue == null) // use string.IsNullOrEmpty instead
              throw new NullReferenceException("someBalue"); // typo, plus should use nameof(...)
          someNumber = int.Parse(someValue);{code}
      

      At this point, only the title will be shown (since it had been supported before, also with noformat and panel markdown).
      And by the way, and thoughts on allowing alternate language specifiers ("csharp" vs. "c#)? A lot of our older issues have the former and will not render correctly at this point.

      Attachments

        Issue Links

          Activity

            People

              mdyro 🦊 Fox (Inactive)
              e1e73c45da94 Emanuel Wlaschitz
              Votes:
              28 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated: