From dfe31a5bd4449202a3d6b5130a32e90a525151ab Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 7 May 2024 19:35:26 -0400 Subject: [PATCH] [infra] Fix spec markdown link processing --- scripts/content-modules/adjust-pages.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/content-modules/adjust-pages.pl b/scripts/content-modules/adjust-pages.pl index dcce592b6af0..28df1b9638b1 100755 --- a/scripts/content-modules/adjust-pages.pl +++ b/scripts/content-modules/adjust-pages.pl @@ -151,8 +151,13 @@ () s|\]\(([^:\)]*?\.md(#.*?)?)\)|]({{% relref "$1" %}})|g; } - # Rewrite link defs - s|^(\[[^\]]+\]:\s*)([^:\s]*)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g; + # Rewrite link defs to local pages such as the following: + # + # [specification]: overview.md + # [faas]: some-path/faas-spans.md (FaaS trace conventions) + # + # The subregex `[:\s]+` excludes external URLs (because they contain a colon after the protocol) + s|^(\[[^\]]+\]:\s*)([^:\s]+)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g; # Make website-local page references local: s|https://opentelemetry.io/|/|g;