Skip to content

Commit

Permalink
8200665: Ensemble: Update SyntaxHighlighter to version 4.0.1
Browse files Browse the repository at this point in the history
Reviewed-by: arapte
  • Loading branch information
kcr committed Jan 10, 2019
1 parent 7a5d068 commit 16e389c
Show file tree
Hide file tree
Showing 6 changed files with 3,849 additions and 110 deletions.
4 changes: 2 additions & 2 deletions apps/samples/Ensemble8/legal/syntaxhighlighter.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## SyntaxHighlighter v3.0.83
## SyntaxHighlighter v4.0.1

### MIT License
<pre>
Copyright (C) 2004-2010 Alex Gorbatchev.
Copyright (c) 2004-2013, Alex Gorbatchev

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates.
* Copyright (c) 2008, 2019, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
Expand Down Expand Up @@ -93,21 +93,19 @@ public SourceTab(URL sourceURL) {

private static final Pattern JAVA_DOC_PATTERN = Pattern.compile("(^\\s+\\*$\\s)?^\\s+\\*\\s+@.*$\\s",Pattern.MULTILINE);
private static String shCoreJs;
private static String shBrushJScript;
private static String shCoreDefaultCss;
private static String shThemeCss;

private static String convertToHTML(String source) {
// load syntax highlighter
if (shCoreJs == null) {
shCoreJs = Utils.loadFile(EnsembleApp.class.getResource("syntaxhighlighter/shCore.js")) +";";
shCoreJs = Utils.loadFile(EnsembleApp.class.getResource("syntaxhighlighter/syntaxhighlighter.js"));
}
if (shBrushJScript == null) {
shBrushJScript = Utils.loadFile(EnsembleApp.class.getResource("syntaxhighlighter/shBrushJava.js"));
if (shThemeCss == null) {
shThemeCss = Utils.loadFile(EnsembleApp.class.getResource("syntaxhighlighter/theme.css"))
.replaceAll("!important","");
}
if (shCoreDefaultCss == null) {
shCoreDefaultCss = Utils.loadFile(EnsembleApp.class.getResource("syntaxhighlighter/shCoreDefault.css")).replaceAll("!important","");
}
// split copy right and source

// split copyright and source
String[] parts = source.split("\\*/",2);
String copyRight = null;
if (parts.length > 1) {
Expand All @@ -128,11 +126,9 @@ private static String convertToHTML(String source) {
html.append(" <head>\n");
html.append(" <script type=\"text/javascript\">\n");
html.append(shCoreJs);
html.append('\n');
html.append(shBrushJScript);
html.append(" </script>\n");
html.append(" <style>\n");
html.append(shCoreDefaultCss);
html.append(shThemeCss);
html.append('\n');
html.append(" .syntaxhighlighter {\n");
html.append(" overflow: visible;\n");
Expand Down Expand Up @@ -176,7 +172,6 @@ private static String convertToHTML(String source) {
html.append(source);
html.append('\n');
html.append(" </pre>\n");
html.append(" <script type=\"text/javascript\"> SyntaxHighlighter.all(); </script>\n");
html.append("</body>\n");
html.append("</html>\n");

Expand Down

This file was deleted.

Loading

0 comments on commit 16e389c

Please sign in to comment.