kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
972 stars 143 forks source link

Accessing page links through a different URL as the `base-url` fails #456

Closed monti-python closed 5 days ago

monti-python commented 3 weeks ago

What happened?

In our company we access the same Confluence instance through different domains depending on the authentication scheme. However, mark hardcodes the entire URL (including the base-url) whenever a Confluence page from the same instance is referenced via relative paths, creating a hard reference to the base-url that was specified at the time mark was invoked.

This can be fixed by removing the hardcoded reference to base-url as Confluence supports relative links to refer to pages under the same Confluence instance.

This would also make the pages and links independent from the current base-url in general, allowing for more flexibility.

What did you expect to happen?

Links to Confluence pages within the same page should always work regardless of the Confluence's hostname/domain.

How can we reproduce the behavior you experienced?

Steps to reproduce the behavior:

  1. Create a page referencing a relative file containing another page, e.g.:

    <!-- Title: PageWithRef -->
    
    See this [page](../path/to/other/page.md)
  2. Create a DNS alias for your Confluence instance
  3. Deploy the page above using the new alias as base-url
  4. Observe how the references above points to the new base-url (DNS alias), even in the regular URL

Further Information (please complete the following information)

monti-python commented 3 weeks ago

Created a PR to solve it: #457

monti-python commented 5 days ago

Solved in #457