Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-81755

Confluence - Code Block Macro in Page Rendering | Large code blocks (e.g., 1.5MB) cause slow page rendering due to syntax highlighting

XMLWordPrintable

      Issue Summary

      The issue arises when a user pastes a large chunk of code, approximately 1.5MB, into a Confluence code block. The syntax highlighting feature, which highlights reserved words based on the selected language, significantly slows down the page rendering process. This is because the macro attempts to render and highlight all JSON keys and other syntax elements, leading to a prolonged processing time on the main thread. As a result, the page becomes unresponsive and unable to process pending instructions.

      Steps to Reproduce

      1. Open a Confluence page and insert a code block macro.
      1. Paste a large code snippet (e.g., 1.5MB of JSON) into the code block.
      1. Select a programming language for syntax highlighting.
      1. Observe the page rendering performance.

      Expected Results

      The page should render quickly and remain responsive, regardless of the size of the code block.

      Actual Results

      The page rendering is significantly slowed down, and the page becomes unresponsive due to the processing required for syntax highlighting.

      Workaround

      • Remove the language property from the code block to avoid syntax highlighting.
      • Attach the large code snippet as a text file instead of pasting it directly into the code block.

              Unassigned Unassigned
              188f830ca5ca Michael Gonzalez (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: