diff --git a/scripts/content-modules/adjust-pages.pl b/scripts/content-modules/adjust-pages.pl index 10bbc5639b27..0c0179d67c2b 100755 --- a/scripts/content-modules/adjust-pages.pl +++ b/scripts/content-modules/adjust-pages.pl @@ -1,4 +1,6 @@ #!/usr/bin/perl -w -i +# +# cSpell:ignore oteps $^W = 1; @@ -169,7 +171,7 @@ () next; } } - if(! $title) { + if (! $title) { ($title) = /^#\s+(.*)/; $linkTitle = ''; printFrontMatter() if $title; @@ -180,7 +182,7 @@ () while(<>) { $lineNum++; last if /<\/details>/; } next; } - if(//) { + if (//) { my $tocstop = ''; while(<>) { $lineNum++; @@ -227,9 +229,13 @@ () # Rewrite paths that are outside of the spec folders as external links: s|\.\.\/README.md|$otelSpecRepoUrl/|g if $ARGV =~ /specification._index/; s|\.\.\/README.md|/docs/specs/otel/| if $ARGV =~ /specification\/library-guidelines.md/; - - s|(\.\.\/)+(experimental\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g; - s|(\.\.\/)+(supplementary-guidelines\/compatibility\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g; + s{ + (\.\.\/)+ + ( + (?:oteps|supplementary-guidelines)\/ + [^)]+ + ) + }{$otelSpecRepoUrl/tree/v$otelSpecVers/$2}gx; s|\.\./((?:examples/)?README\.md)|$otlpSpecRepoUrl/tree/v$otlpSpecVers/$1|g if $ARGV =~ /^tmp\/otlp/;