Parity between Edit Mode and View Mode for Code Block macro syntax highlighting and interactive features (XML / HTML)

XMLWordPrintable

    • 1

      Problem Statement / Summary

      There is a discrepancy in how code snippets (specifically XML and HTML) are rendered and interacted with between Edit mode and Published View mode in Confluence Cloud.

      • In Edit mode, the editor engine provides granular token parsing, distinct color themes, and interactive controls (such as collapsible/expandable nodes and tag-folding).
      • In View mode, the static renderer uses a different highlighting library that produces different token styling and drops interactive features like node folding.

      This causes confusion for technical teams and developers who rely on Confluence for sharing and reviewing large XML/HTML configurations, schemas, and payload documentation.

       


      Suggested Solution

      1. Highlighting Consistency: Align token parsing and styling rules between the view-mode renderer and the edit-mode library so color palettes and tag formatting match across both modes.
      1. Interactive Node Folding in View Mode: Add support for collapsible/expandable nodes (code folding) in published view mode for XML, HTML, JSON, and other structured languages.
      1. Optional Expand/Collapse Controls: Provide macro settings/controls in View Mode to allow readers to "Collapse All" / "Expand All" nested tags or levels.

      Impact / Use Case

      • Developer Experience: Technical documentation frequently contains multi-hundred-line XML/HTML configurations or API responses. Without view-mode folding, users must scroll through massive blocks to reach relevant sections.
      • Consistency: Eliminates customer confusion regarding  inconsistent formatting between preview/editing and the published page.
      • Readability: Improves information hierarchy and readability on customer-facing and internal technical documentation pages.

      Workaround :

      Currently no workaround available for the same. 

              Assignee:
              Unassigned
              Reporter:
              Dollyk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: