Add line number support to the {code} tag in Mark-up.

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • Component/s: None
    • None
    • 0

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

      Add a lineNumber attribute to the code tag such that the value passed will be the starting line number for a code block. When rendered this would show formatted line numbers in the code block to the left of the code listed. Below is an example. If this were supported app wide (jira/confluence etc) it would be quite useful for referencing code in large files. If left blank, lineNumber could start at "1".

      Raw content of code tag
      {code:title=Bar.java|borderStyle=solid|lineNumber=123}
      // Some comments here
      public String getFoo()
      {
          return foo;
      }
      {code}
      
      Rendered content of code tag
      123	// Some comments here
      124	public String getFoo()
      125	{
      126	    return foo;
      127	}
      

      Attached is an image of an example from the Slack app.

        1. Capture.PNG
          Capture.PNG
          43 kB
        2. screenshot-1.png
          screenshot-1.png
          96 kB

            Assignee:
            Unassigned
            Reporter:
            Mitchell Wagner
            Votes:
            25 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: