Skip to content

[BUG] External Markdown links converted to invalid <ac:link> instead of standard <a> tags #213

Description

@Alcarmor

Describe the bug
When converting a Markdown external link, the CLI incorrectly wraps it inside an <ac:link> tag with a <ri:url> resource identifier. This generates a corrupted or unrenderable link because the Confluence Storage Format does not support external URLs within the <ac:link> macro in this manner (which is reserved for internal page links).

To Reproduce
Steps to reproduce the behavior:

  1. Create a Markdown file containing a standard external link:
**My external link:** [My Link Text](https://test.com)
  1. Run the CLI command to convert or publish the file to Confluence.
  2. Inspect the generated page or the raw Storage Format to see the corrupted link structure.

Expected behavior
External links should be converted into standard HTML anchor tags, matching the standard behavior of tools like md2conf. The correct output should be:

<p><strong>My external link:</strong> <a href="https://test.com">My Link Text</a></p>

Environment (please complete the following information):

  • OS: Windows
  • Node.js version: 24
  • confluence-cli version: 2.16.0
  • Confluence version: Confluence On-Premise 9.2.21

Additional context
The CLI currently outputs the following invalid structure for external links:

<p><strong>My external link:</strong> <ac:link><ri:url ri:value="https://test.com" /><ac:plain-text-link-body><![CDATA[My Link Text]]></ac:plain-text-link-body></ac:link></p>

According to Confluence Storage Format specifications, <ac:link> is intended for linking to internal Confluence content (like pages, attachments, or space cards). External URLs should simply map to standard <a> href attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions