Describe the bug
When converting a Markdown file that contains trailing spaces for line breaks, the CLI generates an unclosed <br> tag instead of a valid XHTML tag. This breaks on Confluence On-Premise (Server/Data Center) because its strict XML parser fails to parse the invalid XHTML structure, resulting in a 400 Bad Request error.
To Reproduce
Steps to reproduce the behavior:
- Create a Markdown file with trailing spaces for line breaks (like the example below).
- Run the CLI command to convert and publish the file.
- See error.
Example Markdown content:
# Lines paragraph
**Test Line 1:** line 1
**Test Line 2:** `line 2`
**Test Line 3:** line 3
Expected behavior
The CLI should generate valid Confluence Storage Format (XHTML), using a self-closing <br /> tag so that the Confluence On-Premise XML parser can process it without errors.
Environment (please complete the following information):
- OS: Windows - Node.js version: 24
- confluence-cli version: 2.15.1
- Confluence version: Confluence On-Premise 9.2.21
Additional context
Confluence On-Premise uses a strict XML parser. When the CLI outputs an unclosed <br>, the parser throws an error because it encounters a closing
tag while still expecting the
<br> tag to be closed.
Error logs
{
"message": "Error parsing xhtml: Unexpected close tag
; expected
.\n at [row,col {unknown-source}]: [4,42]. Log referral number is 4e46484c-a88d-4a72-9184-55f9d241d59f",
"reason": "Bad Request"
}
Describe the bug
When converting a Markdown file that contains trailing spaces for line breaks, the CLI generates an unclosed
<br>tag instead of a valid XHTML tag. This breaks on Confluence On-Premise (Server/Data Center) because its strict XML parser fails to parse the invalid XHTML structure, resulting in a 400 Bad Request error.To Reproduce
Steps to reproduce the behavior:
Example Markdown content:
Expected behavior
The CLI should generate valid Confluence Storage Format (XHTML), using a self-closing
<br />tag so that the Confluence On-Premise XML parser can process it without errors.Environment (please complete the following information):
Additional context
tag while still expecting theConfluence On-Premise uses a strict XML parser. When the CLI outputs an unclosed
<br>, the parser throws an error because it encounters a closing<br>tag to be closed.Error logs
; expected{
"message": "Error parsing xhtml: Unexpected close tag
.\n at [row,col {unknown-source}]: [4,42]. Log referral number is 4e46484c-a88d-4a72-9184-55f9d241d59f",
"reason": "Bad Request"
}