From d24d1edfbd46936f78177aec48ddf30ecb07da2f Mon Sep 17 00:00:00 2001 From: David Steele Date: Sat, 18 Jul 2026 18:36:19 +0700 Subject: [PATCH] Resolve markdown cross-page section links to the website. A markdown link that specified both a page and a section failed to render when the target page was itself rendered as markdown, because markdown cannot reliably anchor into another generated file. Resolve these links to the website URL with the section anchor, matching how links to pages that are not rendered as markdown already behave, so a markdown document can link to a section of another. --- doc/lib/pgBackRestDoc/Common/DocRender.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/lib/pgBackRestDoc/Common/DocRender.pm b/doc/lib/pgBackRestDoc/Common/DocRender.pm index 5cb0bf486..939b3dc9e 100644 --- a/doc/lib/pgBackRestDoc/Common/DocRender.pm +++ b/doc/lib/pgBackRestDoc/Common/DocRender.pm @@ -652,14 +652,15 @@ sub processTag } elsif ($strType eq 'markdown') { + # Markdown does not support cross-page section anchors so point at the website if (defined($strSection)) { - confess &log( - ERROR, - "page and section links not supported for type ${strType}, value '" . $oTag->valueGet() . "'"); + $strUrl = '{[backrest-url-base]}/' . $oTag->paramGet('page') . '.html#' . substr($strSection, 1); + } + else + { + $strUrl = "${strPage}.md"; } - - $strUrl = "${strPage}.md"; } else {