Move/rename sponsored links section

This commit is contained in:
Tianon Gravi 2021-09-24 13:50:30 -07:00
parent 372e88d0b9
commit 77bfb4d6a4
1 changed files with 3 additions and 3 deletions

View File

@ -84,9 +84,9 @@ sub prompt_for_edit {
# extract/re-inject sponsored links
my $sponsoredLinks = '';
if ($currentText =~ m{ ( ^ --- \n+ \Q*Useful Resources*\E \n .*? \n --- \n ) }smx) {
if ($currentText =~ m{ ( ^ [#] \Q Sponsored Resources\E \n .*? \n --- \n ) }smx) {
$sponsoredLinks = $1 . "\n";
$proposedText =~ s%$supportedTagsRegex%$1$2$sponsoredLinks%;
$proposedText =~ s%$supportedTagsRegex%$sponsoredLinks$1$2%;
}
my $alwaysShortTags = ($proposedFile eq 'neo4j/README.md');
@ -103,7 +103,7 @@ sub prompt_for_edit {
my $trimmedText = $proposedText;
# if our text is too long for the Hub length limit, let's first try removing the "Supported tags" list and add $tagsNote and see if that's enough to let us put the full image documentation
$trimmedText =~ s%$supportedTagsRegex%$1$tagsNote$sponsoredLinks%ms;
$trimmedText =~ s%$supportedTagsRegex%$sponsoredLinks$1$tagsNote%ms;
# (we scrape until the next "h1" or a line starting with a link which is likely a build status badge for an architecture-namespace)
$proposedText = $trimmedText if $alwaysShortTags;