-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
9.0.3, 9.2.3, 8.5.21
-
None
-
1
-
Severity 3 - Minor
-
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
- Edit a Confluence page.
- Ensure the HTML macro is enabled, and insert it into the page.
- Paste the following content inside the macro:
<style> #main-content { border-top: solid 1px red; } </style>
- Save and publish the page. (A red line should appear at the top of the content area.)
- Edit the page again.
- Copy the line border-top: solid 1px red; without including leading spaces.
- 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>
- 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
- Replicate screen recording attached. leading_spaces.mov
- The non-breaking space (0xA0, encoded as 0xC2A0 in UTF-8) is not recognized as valid whitespace in CSS. It is often introduced during copy-paste from Confluence macros, code blocks, or other rich-text sources. See this bug: https://jira.atlassian.com/browse/CONFSERVER-61142
[CONFSERVER-99546] Non-breaking space (0xA0) in HTML macro causes CSS parsing to fail silently
Status | Original: Needs Triage [ 10030 ] | New: Gathering Impact [ 12072 ] |
Support reference count | New: 1 |
Description |
Original:
h3. 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). h3. Environment Confluence DC h3. Steps to Reproduce # Edit a Confluence page. # Ensure the HTML macro is *enabled*, and insert it into the page. # Paste the following content inside the macro: {code} <style> #main-content { border-top: solid 1px red; } </style> {code} # Save and publish the page. (A red line should appear at the top of the content area.) # Edit the page again. # Copy the line {{border-top: solid 1px red;}} without including leading spaces. # Paste it as a new line and change border-top to border-bottom, so the block looks like this: {code} <style> #main-content { border-top: solid 1px red; border-bottom: solid 1px red; } </style> {code} # Save and publish the page. h3. Expected Results Both border-top and border-bottom styles should be applied correctly. h3. 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. h3. 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. h3. Notes * Replicate screen recording attached. * The non-breaking space (0xA0, encoded as 0xC2A0 in UTF-8) is not recognized as valid whitespace in CSS. It is often introduced during copy-paste from Confluence macros, code blocks, or other rich-text sources. See this bug: https://jira.atlassian.com/browse/CONFSERVER-61142 |
New:
h3. 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). h3. Environment Confluence DC h3. Steps to Reproduce # Edit a Confluence page. # Ensure the HTML macro is *enabled*, and insert it into the page. # Paste the following content inside the macro: {code} <style> #main-content { border-top: solid 1px red; } </style> {code} # Save and publish the page. (A red line should appear at the top of the content area.) # Edit the page again. # Copy the line {{border-top: solid 1px red;}} without including leading spaces. # Paste it as a new line and change border-top to border-bottom, so the block looks like this: {code} <style> #main-content { border-top: solid 1px red; border-bottom: solid 1px red; } </style> {code} # Save and publish the page. h3. Expected Results Both border-top and border-bottom styles should be applied correctly. h3. 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. h3. 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. h3. Notes * Replicate screen recording attached. [^leading_spaces.mov] * The non-breaking space (0xA0, encoded as 0xC2A0 in UTF-8) is not recognized as valid whitespace in CSS. It is often introduced during copy-paste from Confluence macros, code blocks, or other rich-text sources. See this bug: https://jira.atlassian.com/browse/CONFSERVER-61142 |
Attachment | New: leading_spaces.mov [ 493726 ] |
Description |
Original:
h3. 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). h3. Environment Confluence DC h3. Steps to Reproduce # Edit a Confluence page. # Ensure the HTML macro is *enabled*, and insert it into the page. # Paste the following content inside the macro: {code} <style> #main-content { border-top: solid 1px red; } </style> {code} # Save and publish the page. (A red line should appear at the top of the content area.) # Edit the page again. # Copy the line {{border-top: solid 1px red;}} without including leading spaces. # Paste it as a new line and change border-top to border-bottom, so the block looks like this: {code} <style> #main-content { border-top: solid 1px red; border-bottom: solid 1px red; } </style> {code} # Save and publish the page. h3. Expected Results Both border-top and border-bottom styles should be applied correctly. h3. 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. h3. 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. h3. Notes * Replicate screen recording attached. {attachment:id=3af8491b-8371-4490-9315-9868a3765f1a|issueId=8489246|width=200|name=leading_spaces_2025-04-04T03:00:48.103Z.mov} * The non-breaking space (0xA0, encoded as 0xC2A0 in UTF-8) is not recognized as valid whitespace in CSS. It is often introduced during copy-paste from Confluence macros, code blocks, or other rich-text sources. See this bug: https://jira.atlassian.com/browse/CONFSERVER-61142 |
New:
h3. 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). h3. Environment Confluence DC h3. Steps to Reproduce # Edit a Confluence page. # Ensure the HTML macro is *enabled*, and insert it into the page. # Paste the following content inside the macro: {code} <style> #main-content { border-top: solid 1px red; } </style> {code} # Save and publish the page. (A red line should appear at the top of the content area.) # Edit the page again. # Copy the line {{border-top: solid 1px red;}} without including leading spaces. # Paste it as a new line and change border-top to border-bottom, so the block looks like this: {code} <style> #main-content { border-top: solid 1px red; border-bottom: solid 1px red; } </style> {code} # Save and publish the page. h3. Expected Results Both border-top and border-bottom styles should be applied correctly. h3. 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. h3. 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. h3. Notes * Replicate screen recording attached. * The non-breaking space (0xA0, encoded as 0xC2A0 in UTF-8) is not recognized as valid whitespace in CSS. It is often introduced during copy-paste from Confluence macros, code blocks, or other rich-text sources. See this bug: https://jira.atlassian.com/browse/CONFSERVER-61142 |