Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add line breaks in code blocks

MaxMalhotra March 22, 2018

Hi, 

I do know that in Mark Down (md) bitbucket allows for line breaks by adding two spaces at the end of a line. However, this does not work inside code blocks. 

I simply want to have a list of items I copied from notepad++ that are in a vertical list to show up the same way INSIDE a code block WHEN the code blocked is indented 4 spaces. 

Note: To be very specific the code block does wrap if I do not indent the code block 4 spaces, however, I do need to indent the code block 4 spaces so that my line numbering can continue from the previous number after the code block.  (I have tried indenting the list items an additional 4 spaces to no avail as well as trying to put two spaces at the end of the code block). 

 

Recap:

So I need to know either how to wrap items inside a code block when the code block is indented OR I need to know how to continue line numbering without indenting the code block. 

 

Thanks in advance.

 

2 answers

0 votes
Michael Wirth September 28, 2019

1+

0 votes
MaxMalhotra March 23, 2018

What I had originally asked still has not been answered/resolved. 

My Work Around: 

Cons: This solution puts a line number in front of the code block. Which I would have preferred not to be there. Additionally, the implementation of this workaround is a bit convoluted. 

Actions Required: 

    Add a Numeric list. 

    When you want to include a code block, press the Enter Key twice (making sure there is one space between your previous number and the new number. 

    Type out the new number such as 18. Then make sure you have one space after the period.

    Then press the Enter key once. 

    Add 4 spaces to the beginning of the line that you are presently on. 

    Type/Paste your code and this will show up in the code block.  (Now your code block will be wrapped correctly) 

    Continue numbering as normal.  

 

Desired Approach: 

I would like the ability to programmatically assign any number to the numbered list.  

Brian Jones June 20, 2019

This still seems to not be resolved and Better code block is no better really. Not sure why maintaining  a new line character and a tab character is so hard

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events