Code Block Macro has Maximum Number of Lines?

MarkC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 2, 2013

I'm using the Code Block macro to display a rather lengthy XML document on a page. The macro is placed within a double-column layout (not a section macro with columns, but the layout) on the right side.

The line numbering is turned on, but after it reaches line 1476, it no longer continues to number the lines. Is there a maximum line number for this macro?

Also, because it is in a layout with two columns, some of the longer lines are breaking and falling onto the following line. This break is being counted as a line number rather than being skipped in the numbering.

2 answers

1 accepted

0 votes
Answer accepted
William Zanchet [Atlassian]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2013

Hi Mark,

I was able to reproduce the same scenario that you have there. I believe that is due the Word Wrap of the Code Blocks. With that in mind, I was able to create a bug report based on my testings as you can see here:


CodeBlock does not honour the number os lines due to Word Wrap

I would strongly suggest that you vote on this bug report to increase its popularity and add it to your watchlist for future updates.

Cheers,

WZ

1 vote
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 2, 2013

1400 lines is a lot. Maybe you could link to the file in your source control system.

Failing that, I'm be tempted to put it in a gist and embed from github ;)

MarkC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2013

Is there really a maximum on the code block macro? And if so, why is it there?

The individual's requesting this want it to be included directly on the page in full without having to link to it or go somewhere else to see it. I, personally, don't like the idea of embedding it from somewhere else as that adds another layer of maintenance.

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 19, 2013

All I'm saying here is to use the right tool for the right job. If Confluence can't handle it, open an issue with Atlassian, or look for workarounds - I've suggested one.

Maybe theres a limit around 1400 lines because the line numbers are handled client side and your chosen browser borks at that point. I don't know.

Perhaps if you change the page layout to a single column that might left too. I'm guessing the second column may be quite empty for a large part of the page anyway.

MarkC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2013

On every browser I've tried (Chrome, Firefox, IE), the line numbers stop at 1476.

Changing the page layout has no affect. The other column in the layout is actually longer than the code block, so it's not empty in the least.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events