Skip to content

Commit dfe31a5

Browse files
committed
[infra] Fix spec markdown link processing
1 parent 8eb2e74 commit dfe31a5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/content-modules/adjust-pages.pl

+7-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ ()
151151
s|\]\(([^:\)]*?\.md(#.*?)?)\)|]({{% relref "$1" %}})|g;
152152
}
153153

154-
# Rewrite link defs
155-
s|^(\[[^\]]+\]:\s*)([^:\s]*)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g;
154+
# Rewrite link defs to local pages such as the following:
155+
#
156+
# [specification]: overview.md
157+
# [faas]: some-path/faas-spans.md (FaaS trace conventions)
158+
#
159+
# The subregex `[:\s]+` excludes external URLs (because they contain a colon after the protocol)
160+
s|^(\[[^\]]+\]:\s*)([^:\s]+)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g;
156161

157162
# Make website-local page references local:
158163
s|https://opentelemetry.io/|/|g;

0 commit comments

Comments
 (0)