File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/main/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 2828import hudson .ExtensionPoint ;
2929import hudson .model .Item ;
3030import hudson .model .Job ;
31+ import org .apache .commons .lang .StringUtils ;
3132import org .kohsuke .stapler .Stapler ;
3233import org .kohsuke .stapler .StaplerRequest ;
3334
@@ -80,7 +81,7 @@ public final String getDisplayUrl() {
8081
8182 Item i = req .findAncestorObject (Item .class );
8283
83- return req .getContextPath () + '/' + (i == null ? "" : i .getUrl ()) + u ;
84+ return req .getContextPath () + "/" + (i == null ? "" : StringUtils . stripEnd ( i .getUrl (), "/" )) + "/" + u ;
8485 }
8586
8687 /**
@@ -176,6 +177,22 @@ public boolean inNewWindow() {
176177 }
177178
178179 @ Extension (ordinal = 600L )
180+ public static class ExamplesLink extends SnippetizerLink {
181+
182+ @ Nonnull
183+ @ Override
184+ public String getUrl () {
185+ return "https://jenkins.io/doc/pipeline/examples/" ;
186+ }
187+
188+ @ Nonnull
189+ @ Override
190+ public String getDisplayName () {
191+ return Messages .SnippetizerLink_ExamplesLink_displayName ();
192+ }
193+ }
194+
195+ @ Extension (ordinal = 500L )
179196 public static class GDSLLink extends SnippetizerLink {
180197 @ Override
181198 @ Nonnull
You can’t perform that action at this time.
0 commit comments