Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Multi-line Code Blocks


#1

Is there way to create code block similar to Atlasssian Stash, i.e. using 3 backtick quote marks before and after the block, e.g.

typedef NS_ENUM(NSUInteger, RansomwareType) {
    RansomwareType1,
    RansomwareType2,
    RansomwareType3,
    RansomwareType4,
    RansomwareType5
};

and all text will be in monospaced font with reformatted behaviour, i.e. all spaces should stay.
Will be nice to have a different background for this block as well.

Note: The render result (3 backtick quote marks were disappeared) in the forum is exactly what I would like to have


#2

Hi @DKim,

Thanks for your posting! TestRail also supports multi-line code blocks but you would currently need to format the code block manually by adding 4 spaces at the beginning of each line:

http://docs.gurock.com/testrail-userguide/userguide-editor#code_and_preformatted_text

Cheers,
Tobias


#3

Thanks, it does work.

I had this problem, because I had some text above my code block, i.e. an empty line is required above the perforated code block.


#4

Yes, code blocks require an empty line before/after but good to hear that it works now!

Cheers,
Tobias


#5

Thanks, probably Editor formatting reference should be updated.

Dmitry


#6

Thanks, Dmitry, just updated the editor documentation.

Cheers,
Tobias


#7

It would be really helpful to my company if the way Atlassian handles multi-line code blocks were implemented in TestRail, using 3 backticks. There are times we have to include large blocks of code, and it is a hassle to go through and add 4 spaces to each line. 3 backticks before and after would be much more elegant and efficient. Please consider implementing this.


#8

Hi Tracey,

Thanks for your feedback, that’s appreciated!

Cheers,
Tobias


#9

When will this feature be implemented?
Any plans?