Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-99546

Non-breaking space (0xA0) in HTML macro causes CSS parsing to fail silently

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 9.0.3, 9.2.3, 8.5.21
    • Editor - Core
    • None

      Problem

      When a non-breaking space character (0xA0) is present at the beginning of a CSS rule inside the HTML macro, the rule fails to apply due to invalid parsing. This issue is difficult to detect because the non-breaking space looks identical to a regular space (0x20).

      Environment

      Confluence DC

      Steps to Reproduce

      1. Edit a Confluence page.
      2. Ensure the HTML macro is enabled, and insert it into the page.
      3. Paste the following content inside the macro:
        <style>
        #main-content {
          border-top: solid 1px red;
        }
        </style>
        
      4. Save and publish the page. (A red line should appear at the top of the content area.)
      5. Edit the page again.
      6. Copy the line border-top: solid 1px red; without including leading spaces.
      7. Paste it as a new line and change border-top to border-bottom, so the block looks like this:
        <style>
        #main-content {
          border-top: solid 1px red;
          border-bottom: solid 1px red;
        }
        </style>
        
      8. Save and publish the page.

      Expected Results

      Both border-top and border-bottom styles should be applied correctly.

      Actual Results

      Only border-top is applied.
      The line with the non-breaking space (0xA0) is ignored by the browser's CSS parser and does not apply.

      Workaround

      • Manually delete and retype the space before the affected line using the spacebar.
      • Manually copy the whole line including the leading spaces.
      • Alternatively, pre-clean the content in a plain-text editor (e.g., VS Code) before pasting into the HTML macro.

      Notes

            [CONFSERVER-99546] Non-breaking space (0xA0) in HTML macro causes CSS parsing to fail silently

            No work has yet been logged on this issue.

              Unassigned Unassigned
              lwang3@atlassian.com Lei Wang
              Affected customers:
              2 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated: