Closed asgrim closed 2 months ago
It would be great if anchors can also work (i.e. links to specific headings) - I assume it'd be a case of adding IDs and preserving hash segments in URLs
Note: Confluence already creates the anchors themselves, for every heading, automatically - but the links TO the anchors are structured very differently (they auto generate an id=...
attribute for each heading, based on the heading content).
So we'd need to do something like:
So we'd need to do something like:
* explicitly add a markdown anchor * replace the link during conversion to link to an ID based on the heading contents ?
Yep, but just the second one - Confluence automatically adds anchors to all headings; we just need to replace the links with the correct fragment when pushing to Confluence
I mean that if someone has added a markdown anchor (which there actually seems like there are >1 format for) we'd need to resolve it to a heading, then rewrite the link to the heading text. I agree we'd not need to add an ID to the heading itself.
Given a link like
[Reporting Overview](./another-file.md)
, assuminganother-file.md
also has aconfluencePageId
, we could replace the link with a Confluence link, e.g.https://<confluence-url>/pages/viewpage.action?pageId=<linkedConfluencePageId>
.