├── .gitignore ├── .mvn ├── maven.config └── extensions.xml ├── Jenkinsfile ├── src └── main │ ├── resources │ ├── index.jelly │ └── org │ │ └── jenkinsci │ │ └── plugins │ │ └── UnsafeMarkupFormatter │ │ └── config.jelly │ └── java │ └── org │ └── jenkinsci │ └── plugins │ └── UnsafeMarkupFormatter.java ├── .github └── workflows │ └── cd.yaml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings/ 4 | target/ 5 | work/ 6 | .idea 7 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Pconsume-incrementals 2 | -Pmight-produce-incrementals 3 | -Dchangelist.format=%d.v%s 4 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | buildPlugin(useContainerAgent: true, configurations: [ 2 | [platform: 'linux', jdk: '11'], 3 | [platform: 'linux', jdk: '17'] 4 | ]) 5 | -------------------------------------------------------------------------------- /src/main/resources/index.jelly: -------------------------------------------------------------------------------- 1 | 2 |
3 | This plugin adds a markup formatter that's unsafe but allows more powerful 4 | HTML manipulation. 5 |
6 | -------------------------------------------------------------------------------- /src/main/resources/org/jenkinsci/plugins/UnsafeMarkupFormatter/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This markup formatter supports arbitrary HTML, including potentially dangerous elements like "script" 5 | and so on. Use with caution. 6 | 7 | 8 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.jenkins.tools.incrementals 4 | git-changelist-maven-extension 5 | 1.4 6 | 7 | 8 | -------------------------------------------------------------------------------- /.github/workflows/cd.yaml: -------------------------------------------------------------------------------- 1 | # Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins 2 | 3 | name: cd 4 | on: 5 | workflow_dispatch: 6 | check_run: 7 | types: 8 | - completed 9 | 10 | jobs: 11 | maven-cd: 12 | uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1 13 | secrets: 14 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 15 | MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} 16 | -------------------------------------------------------------------------------- /src/main/java/org/jenkinsci/plugins/UnsafeMarkupFormatter.java: -------------------------------------------------------------------------------- 1 | package org.jenkinsci.plugins; 2 | 3 | import hudson.Extension; 4 | import hudson.markup.MarkupFormatter; 5 | import hudson.markup.MarkupFormatterDescriptor; 6 | import org.kohsuke.stapler.DataBoundConstructor; 7 | 8 | import java.io.IOException; 9 | import java.io.Writer; 10 | 11 | /** 12 | * @author Kohsuke Kawaguchi 13 | */ 14 | public class UnsafeMarkupFormatter extends MarkupFormatter { 15 | @DataBoundConstructor 16 | public UnsafeMarkupFormatter() { 17 | } 18 | 19 | @Override 20 | public void translate(String markup, Writer output) throws IOException { 21 | if (markup != null) { 22 | output.write(markup); 23 | } 24 | } 25 | 26 | @Extension 27 | public static class DescriptorImpl extends MarkupFormatterDescriptor { 28 | @Override 29 | public String getDisplayName() { 30 | return "Allows arbitrary HTML including JavaScript (UNSAFE)"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | org.jenkins-ci.plugins 5 | plugin 6 | 4.53 7 | 8 | 9 | 10 | 11 | 999999-SNAPSHOT 12 | 2.361.4 13 | 14 | 15 | anything-goes-formatter 16 | ${changelist} 17 | hpi 18 | https://wiki.jenkins-ci.org/JENKINS/60915753.html 19 | 20 | 21 | 22 | 23 | repo.jenkins-ci.org 24 | https://repo.jenkins-ci.org/public/ 25 | 26 | 27 | 28 | 29 | 30 | repo.jenkins-ci.org 31 | https://repo.jenkins-ci.org/public/ 32 | 33 | 34 | 35 | 36 | 37 | kohsuke 38 | Kohsuke Kawaguchi 39 | kk@kohsuke.org 40 | 41 | 42 | 43 | 44 | scm:git:https://github.com/jenkinsci/anything-goes-formatter-plugin.git 45 | scm:git:ssh://git@github.com/jenkinsci/anything-goes-formatter-plugin.git 46 | https://github.com/jenkinsci/anything-goes-formatter-plugin 47 | ${scmTag} 48 | 49 | 50 | --------------------------------------------------------------------------------