Package jetbrains.buildServer.web.util
Class ColorerSyntaxHighlighter
- java.lang.Object
-
- jetbrains.buildServer.web.util.ColorerSyntaxHighlighter
-
@NonNls public class ColorerSyntaxHighlighter extends Object
Highlights source code using JHighlight library. JHighlight supports a rather limited set of languages, so many languages are highlighted on the client-side with a JS library.
-
-
Constructor Summary
Constructors Constructor Description ColorerSyntaxHighlighter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getStyle(String name)
Returns the style that needs to be embedded in result HTML.static String
highlight(String source, String name)
Highlight source and output as styled HTML
-
-
-
Method Detail
-
highlight
@Nullable public static String highlight(@NotNull String source, @NotNull String name) throws IOException
Highlight source and output as styled HTML- Parameters:
source
- textname
- source file name to help deduce language- Returns:
- styled HTML, or null
- Throws:
IOException
- if I/O error occurs
-
-