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

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

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 4
    • 1
    • 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.

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? 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
          43 kB
          Mitchell Wagner

              Unassigned Unassigned
              ec042c272d04 Mitchell Wagner
              Votes:
              100 Vote for this issue
              Watchers:
              43 Start watching this issue

                Created:
                Updated: