/hudson-core/src/main/java/hudson/markup/RawHtmlMarkupFormatter.java

http://github.com/hudson/hudson · Java · 34 lines · 22 code · 6 blank · 6 comment · 0 complexity · a8a3b2bc499066b68f01cb7422c9d755 MD5 · raw file

  1. package hudson.markup;
  2. import hudson.Extension;
  3. import org.kohsuke.stapler.DataBoundConstructor;
  4. import java.io.IOException;
  5. import java.io.Writer;
  6. /**
  7. * {@link MarkupFormatter} that treats the input as the raw html.
  8. * This is the backward compatible behaviour.
  9. *
  10. * @author Kohsuke Kawaguchi
  11. */
  12. public class RawHtmlMarkupFormatter extends MarkupFormatter {
  13. @DataBoundConstructor
  14. public RawHtmlMarkupFormatter() {
  15. }
  16. @Override
  17. public void translate(String markup, Writer output) throws IOException {
  18. output.write(markup);
  19. }
  20. @Extension
  21. public static class DescriptorImpl extends MarkupFormatterDescriptor {
  22. @Override
  23. public String getDisplayName() {
  24. return "Raw HTML";
  25. }
  26. }
  27. public static MarkupFormatter INSTANCE = new RawHtmlMarkupFormatter();
  28. }