@@ -151,35 +151,37 @@ public JComponent getPreferredFocusedComponent() {
151151 .append ("<script src=\" " ).append (PreviewStaticServer .getScriptUrl ("processImages.js" )).append ("\" ></script>\n " )
152152 .append ("<script src=\" " ).append (PreviewStaticServer .getScriptUrl ("pickSourceLine.js" )).append ("\" ></script>\n " )
153153 .append ("<script src=\" " ).append (PreviewStaticServer .getScriptUrl ("mouseEvents.js" )).append ("\" ></script>\n " )
154- .append ("<script type=\" text/x-mathjax-config\" >\n " +
155- "MathJax.Hub.Config({\n " +
156- " messageStyle: \" none\" ,\n " +
157- " EqnChunkDelay: 1," +
158- " imageFont: null," +
159- " tex2jax: {\n " +
160- " inlineMath: [[\" \\ \\ (\" , \" \\ \\ )\" ]],\n " +
161- " displayMath: [[\" \\ \\ [\" , \" \\ \\ ]\" ]],\n " +
162- " ignoreClass: \" nostem|nolatexmath\" \n " +
163- " },\n " +
164- " asciimath2jax: {\n " +
165- " delimiters: [[\" \\ \\ $\" , \" \\ \\ $\" ]],\n " +
166- " ignoreClass: \" nostem|noasciimath\" \n " +
167- " },\n " +
168- " TeX: { equationNumbers: { autoNumber: \" none\" } }\n " +
169- "});\n " +
170- "MathJax.Hub.Register.MessageHook(\" Math Processing Error\" ,function (message) {\n " +
171- " window.JavaPanelBridge && window.JavaPanelBridge.log(JSON.stringify(message)); \n " +
172- "});" +
173- "MathJax.Hub.Register.MessageHook(\" TeX Jax - parse error\" ,function (message) {\n " +
174- " var errortext = document.getElementById('mathjaxerrortext'); " +
175- " var errorformula = document.getElementById('mathjaxerrorformula'); " +
176- " if (errorformula && errortext) { " +
177- " errortext.textContent = 'Math Formula problem: ' + message[1]; " +
178- " errorformula.textContent = '\\ n' + message[2]; " +
179- " } " +
180- " window.JavaPanelBridge && window.JavaPanelBridge.log(JSON.stringify(message)); \n " +
181- "});" +
182- "</script>\n " )
154+ .append ("""
155+ <script type="text/x-mathjax-config">
156+ MathJax.Hub.Config({
157+ messageStyle: "none",
158+ EqnChunkDelay: 1,\
159+ imageFont: null,\
160+ tex2jax: {
161+ inlineMath: [["\\ \\ (", "\\ \\ )"]],
162+ displayMath: [["\\ \\ [", "\\ \\ ]"]],
163+ ignoreClass: "nostem|nolatexmath"
164+ },
165+ asciimath2jax: {
166+ delimiters: [["\\ \\ $", "\\ \\ $"]],
167+ ignoreClass: "nostem|noasciimath"
168+ },
169+ TeX: { equationNumbers: { autoNumber: "none" } }
170+ });
171+ MathJax.Hub.Register.MessageHook("Math Processing Error",function (message) {
172+ window.JavaPanelBridge && window.JavaPanelBridge.log(JSON.stringify(message));\s
173+ });\
174+ MathJax.Hub.Register.MessageHook("TeX Jax - parse error",function (message) {
175+ var errortext = document.getElementById('mathjaxerrortext'); \
176+ var errorformula = document.getElementById('mathjaxerrorformula'); \
177+ if (errorformula && errortext) { \
178+ errortext.textContent = 'Math Formula problem: ' + message[1]; \
179+ errorformula.textContent = '\\ n' + message[2]; \
180+ } \
181+ window.JavaPanelBridge && window.JavaPanelBridge.log(JSON.stringify(message));\s
182+ });\
183+ </script>
184+ """ )
183185 .append ("<script src=\" " ).append (PreviewStaticServer .getScriptUrl ("MathJax/MathJax.js" )).append ("&config=TeX-MML-AM_HTMLorMML\" ></script>\n " )
184186 .toString ();
185187 });
@@ -977,16 +979,12 @@ public void render() {
977979
978980 private boolean isDarcula () {
979981 final AsciiDocApplicationSettings settings = AsciiDocApplicationSettings .getInstance ();
980- switch (settings .getAsciiDocPreviewSettings ().getPreviewTheme ()) {
981- case INTELLIJ :
982- return !JBColor .isBright ();
983- case ASCIIDOC :
984- return false ;
985- case DARCULA :
986- return true ;
987- default :
988- return false ;
989- }
982+ return switch (settings .getAsciiDocPreviewSettings ().getPreviewTheme ()) {
983+ case INTELLIJ -> !JBColor .isBright ();
984+ case ASCIIDOC -> false ;
985+ case DARCULA -> true ;
986+ default -> false ;
987+ };
990988 }
991989
992990
0 commit comments