Publishing links - header and anchor links
In-page links to another page in the source space are updated to published pages in the target space on publishing.
However, Confluence treats links to and from headings and anchors differently than the Confluence link types added in the body of a page.
links to anchors or headings are not updated except when they are created in macros such as the Confluence child or page tree macro
a link added to a header in a source space page is not updated on publishing the page
The published page links to another source space page and directs you to a draft page.
Page headers with a link to another page in the source space
Links added to page headers
A link to another space page added to a page header is not updated on the published target space page. These links are treated as absolute links.
Solution
Avoid adding a link to a page heading.
If a link is required, add it to the text body of the appropriate section or configure it to the published target space page.
Links to in-page headings or anchors in another source space page
In-page hyperlinks to headings or anchors in another source space page are not updated to the destination target space pages when a page is published. Example In a source space page, Product Lifecycle, a link to a page heading, User interface in the source space page Product MVP is added as an in-page link. If you click the in-page link in the published Product Lifecycle page in the target space, you are directed to the PMCD source space page. The link has not been updated to the target space Product MVP page. In-page links on a source space page created using macros such as the children or page tree macros are updated. When using Confluence page macros to add dynamic content to source space content, for example, the content by label macros, set a filter in the macro as the In-page links to headings and anchors added to Confluence link types
https://appfire.atlassian.net/wiki/spaces/PMCD/pages/614696410/Product+MVP#User+interface
In-page links created in macros
current space
. When publishing the page, the macro displays content in the target space.