aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-14 14:59:48 +0300
committerBonfaceKilz2024-08-29 18:58:56 +0300
commit5f445740aff4330b37f53b23449167493b70e692 (patch)
tree6872879a41d5d471f34307cb69fc79c5d2a101a4
parent19c0ac1239bcba1a8c935e14021847439fb1d5d2 (diff)
downloadgenenetwork2-5f445740aff4330b37f53b23449167493b70e692.tar.gz
Feature: Enable codeblocks highlighting.
-rw-r--r--gn2/wqflask/templates/gn_editor.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html
index 2096c3de..8b5027db 100644
--- a/gn2/wqflask/templates/gn_editor.html
+++ b/gn2/wqflask/templates/gn_editor.html
@@ -5,6 +5,7 @@
<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='diff2html/diff2html.min.css') }}" />
+<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='highlight/default.min.css') }}" />
<style>
</style>
@@ -55,9 +56,9 @@
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jsdiff/diff.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='ace/ace.js') }}"></script>
-
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='marked/marked.min.js') }}"></script>
-<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='marked/marked-highlight.js') }}"></script>
+-<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='marked/marked-highlight.js') }}"></script>
+-<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='highlight/highlight.min.js') }}"></script>>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
@@ -72,7 +73,7 @@
behavioursEnabled: true, // boolean: true if enable custom behaviours
wrapBehavioursEnabled: true, // boolean
autoScrollEditorIntoView: undefined, // boolean: this is needed if editor is inside scrollable
- keyboardHandler: "ace/keyboard/emacs",
+ keyboardHandler: null,
// renderer options
animatedScroll: false, // boolean: true if scroll should be animated
@@ -95,7 +96,7 @@
maxPixelHeight: 0, // number -> maxLines: set the maximum height in pixel, when 'maxLines' is defined.
scrollPastEnd: 0, // number -> !maxLines: if positive, user can scroll pass the last line and go n * editorHeight more distance
fixedWidthGutter: false, // boolean: true if the gutter should be fixed width
- theme: "ace/theme/text", // theme string from ace/theme or custom?
+ theme: "ace/theme/textmate", // theme string from ace/theme or custom?
scrollSpeed: 2, // number: the scroll speed index
dragDelay: 0,
dragEnabled: true, // boolean: enable dragging
@@ -141,6 +142,7 @@
})
function updatePreview(){
const {markedHighlight} = globalThis.markedHighlight;
+
let new_marked = new marked.Marked(
markedHighlight({
langPrefix: 'hljs language-',