aboutsummaryrefslogtreecommitdiffstats
path: root/spring-front/src/components/Left.js
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-03-23 12:32:43 +0000
committerterminaldweller <thabogre@gmail.com>2022-03-23 12:32:43 +0000
commita5b28f29dd683191433a70b2c3c21e06de265717 (patch)
tree714dbfd5caf284df4373ba9a1503e9e5ba83292e /spring-front/src/components/Left.js
parentwip (diff)
downloadmdrtl-a5b28f29dd683191433a70b2c3c21e06de265717.tar.gz
mdrtl-a5b28f29dd683191433a70b2c3c21e06de265717.zip
wip
Diffstat (limited to 'spring-front/src/components/Left.js')
-rw-r--r--spring-front/src/components/Left.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/spring-front/src/components/Left.js b/spring-front/src/components/Left.js
new file mode 100644
index 0000000..7abeed4
--- /dev/null
+++ b/spring-front/src/components/Left.js
@@ -0,0 +1,34 @@
+import React from "react";
+import hljs from "highlight.js/lib/core";
+import markdown from "highlight.js/lib/languages/markdown";
+import "highlight.js/styles/devibeans.css";
+import "../index.css";
+
+hljs.registerLanguage("markdown", markdown);
+
+function update(text) {
+ let result_element = document.querySelector("#highlight-content");
+ result_element.innerText = text;
+ return hljs.highlight(text, { language: "markdown" }).value;
+}
+
+function CreateTextArea() {
+ return <textarea name="editor" className="editor" id="editor"></textarea>;
+}
+
+function CreatePreCode() {
+ return (
+ <pre id="highlight" aria-hidden="true">
+ <code className="language-markdown" id="highlight-content"></code>
+ </pre>
+ );
+}
+
+export default function Left() {
+ return (
+ <div>
+ <CreateTextArea />
+ <CreatePreCode />
+ </div>
+ );
+}