You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has to be slightly more clever than the warning at the beginning to try and avoid weird markdown rendering (so it looks reasonably clean) but it isn't *too* horrible.
Copy file name to clipboardExpand all lines: push.pl
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,9 @@ sub prompt_for_edit {
96
96
my$fullUrl = "$githubBase/$proposedFile";
97
97
my$shortTags = "-\tSee [\"Supported tags and respective \`Dockerfile\` links\" at $fullUrl]($fullUrl#supported-tags-and-respective-dockerfile-links)\n\n";
98
98
my$tagsNote = "**Note:** the description for this image is longer than the Hub length limit of $lengthLimit, so the \"Supported tags\" list has been trimmed to compensate. See [docker/hub-beta-feedback#238](https://github.com/docker/hub-beta-feedback/issues/238) for more information.\n\n" . $shortTags;
99
-
my$genericNote = "**Note:** the description for this image is longer than the Hub length limit of $lengthLimit, so has been trimmed. The full description can be found at [$fullUrl]($fullUrl). See [docker/hub-beta-feedback#238](https://github.com/docker/hub-beta-feedback/issues/238) for more information.\n\n";
99
+
my$genericNote = "**Note:** the description for this image is longer than the Hub length limit of $lengthLimit, so has been trimmed. The full description can be found at [$fullUrl]($fullUrl). See [docker/hub-beta-feedback#238](https://github.com/docker/hub-beta-feedback/issues/238) for more information.";
100
+
my$startingNote = $genericNote . "\n\n";
101
+
my$endingNote = "\n\n...\n\n" . $genericNote;
100
102
101
103
$tagsNote = $shortTagsif$alwaysShortTags;
102
104
@@ -110,7 +112,19 @@ sub prompt_for_edit {
110
112
111
113
if (length($trimmedText) > $lengthLimit) {
112
114
# ... if that doesn't do the trick, then do our older naïve description trimming
# adding the "ending note" (https://github.com/docker/hub-feedback/issues/2220) is a bit more complicated as we have to deal with cutting off markdown ~cleanly so it renders correctly
118
+
# TODO deal with "```foo" appropriately (so we don't drop our note in the middle of a code block) - the Hub's current markdown rendering (2022-04-07) does not auto-close a dangling block like this, so this isn't urgent
119
+
if ($trimmedText =~ m/\n$/) {
120
+
# if we already end with a newline, we should be fine to just trim newlines and add our ending note
121
+
$trimmedText =~ s/\n+$//;
122
+
}
123
+
else {
124
+
# otherwise, we need to get a little bit more creative and trim back to the last fully blank line (which we can reasonably assume is safe thanks to our markdownfmt)
0 commit comments