aboutsummaryrefslogtreecommitdiffstats
path: root/spring-front/src/components
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-03-31 19:53:29 +0000
committerterminaldweller <thabogre@gmail.com>2022-03-31 19:53:29 +0000
commitfb5715c3dd5dd4b8171fdaecf01b24efac20570e (patch)
treed4180fd30841807d4c0198cae7b3399dcfdcbc21 /spring-front/src/components
parentwip (diff)
downloadmdrtl-fb5715c3dd5dd4b8171fdaecf01b24efac20570e.tar.gz
mdrtl-fb5715c3dd5dd4b8171fdaecf01b24efac20570e.zip
wip
Diffstat (limited to 'spring-front/src/components')
-rw-r--r--spring-front/src/components/Editor.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/spring-front/src/components/Editor.js b/spring-front/src/components/Editor.js
index 932cc06..81ee58e 100644
--- a/spring-front/src/components/Editor.js
+++ b/spring-front/src/components/Editor.js
@@ -1,6 +1,7 @@
import React from "react";
import ReactDOM from "react-dom";
import hljs from "highlight.js/lib/core";
+// const hljs = window.hljs;
import "highlight.js/styles/devibeans.css";
import markdown from "highlight.js/lib/languages/markdown.js";
import "../index.css";
@@ -35,13 +36,14 @@ export default class Editor extends React.Component {
this.state = { value: "" };
}
- // TODO-we should highlight through a web worker
+ // TODO-use web worker instead
updateCodeSyntaxHighlighting() {
document.querySelectorAll("pre code").forEach((block) => {
hljs.highlightElement(block);
});
}
+ // TODO-use web worker instead
parseMarkdown() {
let element = document.getElementById("markdown-placeholder");
let md = new mit();